Swift SDK for Jellyfin
Go to file
2022-08-17 22:26:58 -06:00
JellyfinAPI.doccarchive generate with CreateAPI 0.1.0 and doccarchive 2022-08-16 23:32:51 -06:00
Plugins/CreateAPI lint 2022-08-17 15:08:41 -06:00
Sources update documentation 2022-08-17 22:26:58 -06:00
.gitignore Update .gitignore 2022-08-16 23:39:51 -06:00
.swiftformat update 2022-08-15 20:37:47 -06:00
Package.resolved fix Get package 2022-08-08 14:23:59 -06:00
Package.swift lint 2022-08-17 15:08:41 -06:00
README.md update documentation 2022-08-17 22:26:58 -06:00

Swift SDK Jellyfin

Swift SDK to work with Jellyfin servers.

Generated using CreateAPI

Usage

The provided JellyfinClient uses an underlying Get APIClient to provide basic functionality for interfacing with a Jellyfin server:

  • inject required headers for every request
  • encoding/decoding of all Date values to expected
  • signIn for generating a session access token
  • signOut for revoking the current access token
// Create 
let jellyfinClient = JellyfinClient(configuration: configuration)

// Provided by JellyfinClient
let response = jellyfinClient.signIn(username: "jelly", password: "fin")

You can forego JellyfinClient and use your own network stack, using the provided Entities and Paths.

Generation

The mechanism for generating Entities, Extensions, and Paths with CreateAPI is provided as an Xcode command plugin.

  1. Download the latest Jellyfin schema
  2. Move the schema to Sources
  3. Delete the current Entities, Extensions, and Paths directories
  4. Run the following command in the package directory:
# runs the CreateAPI Xcode command plugin
$ swift package --allow-writing-to-package-directory generate-api
  1. New Entities, Extensions, and Paths directories should be available within the package

Alternatively, you can generate your own Swift Jellyfin SDK using CreateAPI or any other OpenAPI generator.