Update to CreateAPI 0.2.0 (#22)

This commit is contained in:
Ethan Pippin 2023-08-30 16:09:52 -06:00 committed by GitHub
parent 23691720c2
commit ecc338b4ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
422 changed files with 473 additions and 496 deletions

View File

@ -34,8 +34,8 @@ let package = Package(
),
.binaryTarget(
name: "create-api",
url: "https://github.com/CreateAPI/CreateAPI/releases/download/0.1.0/create-api.artifactbundle.zip",
checksum: "4e9d1fb023c52e423d57de0928da5d943e3e4c81f6cb903523654867e6372db7"
url: "https://github.com/CreateAPI/CreateAPI/releases/download/0.2.0/create-api.artifactbundle.zip",
checksum: "6f8a3ce099f07eb2655ccaf6f66d8c9a09b74bb2307781c4adec36609ddac009"
),
.plugin(
name: "CreateAPI",

View File

@ -77,7 +77,7 @@ struct Plugin: CommandPlugin {
.appending(["Sources", "jellyfin-openapi-stable.json"])
let decoder = JSONDecoder()
let data = Data(referencing: try NSData(contentsOfFile: filePath.string))
let data = try Data(referencing: NSData(contentsOfFile: filePath.string))
return try decoder.decode(AnyJSON.self, from: data)
}
@ -186,7 +186,7 @@ struct Plugin: CommandPlugin {
.directory
.appending(["Plugins", "CreateAPI", "PatchFiles", "SpecialFeatureType.swift"])
let sourceData = Data(referencing: try NSData(contentsOfFile: sourceFilePath.string))
let sourceData = try Data(referencing: NSData(contentsOfFile: sourceFilePath.string))
let finalFilePath = context
.package

View File

@ -270,7 +270,7 @@ public struct BaseItemDto: Codable, Hashable, Identifiable {
public var timerID: String?
/// Gets or sets the trailer count.
public var trailerCount: Int?
/// Gets or sets the type.
/// The base item kind.
public var type: BaseItemKind?
/// Gets or sets the user data for this item based on the user it's being requested for.
public var userData: UserItemDataDto?

View File

@ -10,17 +10,20 @@ import Foundation
public struct ClientCapabilities: Codable, Hashable {
public var appStoreURL: String?
/// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.
/// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to
/// play.
///
/// <br />
///
/// Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and
///
/// <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)
/// <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and
/// levels)
///
/// the device is able to direct play (without transcoding or remuxing),
///
/// as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't.
/// as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in
/// case it isn't.
public var deviceProfile: DeviceProfile?
public var iconURL: String?
public var messageCallbackURL: String?

View File

@ -18,7 +18,8 @@ import Foundation
///
/// the device is able to direct play (without transcoding or remuxing),
///
/// as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't.
/// as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case
/// it isn't.
public struct DeviceProfile: Codable, Hashable, Identifiable {
/// Gets or sets the AlbumArtPn.
public var albumArtPn: String?

View File

@ -26,7 +26,7 @@ public struct DisplayPreferencesDto: Codable, Hashable, Identifiable {
public var isRememberIndexing: Bool?
/// Gets or sets a value indicating whether [remember sorting].
public var isRememberSorting: Bool?
/// Gets or sets the scroll direction.
/// An enum representing the axis that should be scrolled.
public var scrollDirection: ScrollDirection?
/// Gets or sets a value indicating whether to show backdrops on this item.
public var isShowBackdrop: Bool?
@ -34,7 +34,7 @@ public struct DisplayPreferencesDto: Codable, Hashable, Identifiable {
public var isShowSidebar: Bool?
/// Gets or sets the sort by.
public var sortBy: String?
/// Gets or sets the sort order.
/// An enum representing the sorting order.
public var sortOrder: SortOrder?
/// Gets or sets the type of the view.
public var viewType: String?

View File

@ -41,10 +41,10 @@ public struct EncodingOptions: Codable, Hashable {
public var throttleDelaySeconds: Int?
public var tonemappingAlgorithm: String?
public var tonemappingDesat: Double?
public var tonemappingMode: String?
public var tonemappingParam: Double?
public var tonemappingPeak: Double?
public var tonemappingRange: String?
public var tonemappingThreshold: Double?
public var transcodingTempPath: String?
public var vaapiDevice: String?
public var vppTonemappingBrightness: Double?
@ -81,10 +81,10 @@ public struct EncodingOptions: Codable, Hashable {
throttleDelaySeconds: Int? = nil,
tonemappingAlgorithm: String? = nil,
tonemappingDesat: Double? = nil,
tonemappingMode: String? = nil,
tonemappingParam: Double? = nil,
tonemappingPeak: Double? = nil,
tonemappingRange: String? = nil,
tonemappingThreshold: Double? = nil,
transcodingTempPath: String? = nil,
vaapiDevice: String? = nil,
vppTonemappingBrightness: Double? = nil,
@ -120,10 +120,10 @@ public struct EncodingOptions: Codable, Hashable {
self.throttleDelaySeconds = throttleDelaySeconds
self.tonemappingAlgorithm = tonemappingAlgorithm
self.tonemappingDesat = tonemappingDesat
self.tonemappingMode = tonemappingMode
self.tonemappingParam = tonemappingParam
self.tonemappingPeak = tonemappingPeak
self.tonemappingRange = tonemappingRange
self.tonemappingThreshold = tonemappingThreshold
self.transcodingTempPath = transcodingTempPath
self.vaapiDevice = vaapiDevice
self.vppTonemappingBrightness = vppTonemappingBrightness
@ -165,10 +165,10 @@ public struct EncodingOptions: Codable, Hashable {
self.throttleDelaySeconds = try values.decodeIfPresent(Int.self, forKey: "ThrottleDelaySeconds")
self.tonemappingAlgorithm = try values.decodeIfPresent(String.self, forKey: "TonemappingAlgorithm")
self.tonemappingDesat = try values.decodeIfPresent(Double.self, forKey: "TonemappingDesat")
self.tonemappingMode = try values.decodeIfPresent(String.self, forKey: "TonemappingMode")
self.tonemappingParam = try values.decodeIfPresent(Double.self, forKey: "TonemappingParam")
self.tonemappingPeak = try values.decodeIfPresent(Double.self, forKey: "TonemappingPeak")
self.tonemappingRange = try values.decodeIfPresent(String.self, forKey: "TonemappingRange")
self.tonemappingThreshold = try values.decodeIfPresent(Double.self, forKey: "TonemappingThreshold")
self.transcodingTempPath = try values.decodeIfPresent(String.self, forKey: "TranscodingTempPath")
self.vaapiDevice = try values.decodeIfPresent(String.self, forKey: "VaapiDevice")
self.vppTonemappingBrightness = try values.decodeIfPresent(Double.self, forKey: "VppTonemappingBrightness")
@ -210,10 +210,10 @@ public struct EncodingOptions: Codable, Hashable {
try values.encodeIfPresent(throttleDelaySeconds, forKey: "ThrottleDelaySeconds")
try values.encodeIfPresent(tonemappingAlgorithm, forKey: "TonemappingAlgorithm")
try values.encodeIfPresent(tonemappingDesat, forKey: "TonemappingDesat")
try values.encodeIfPresent(tonemappingMode, forKey: "TonemappingMode")
try values.encodeIfPresent(tonemappingParam, forKey: "TonemappingParam")
try values.encodeIfPresent(tonemappingPeak, forKey: "TonemappingPeak")
try values.encodeIfPresent(tonemappingRange, forKey: "TonemappingRange")
try values.encodeIfPresent(tonemappingThreshold, forKey: "TonemappingThreshold")
try values.encodeIfPresent(transcodingTempPath, forKey: "TranscodingTempPath")
try values.encodeIfPresent(vaapiDevice, forKey: "VaapiDevice")
try values.encodeIfPresent(vppTonemappingBrightness, forKey: "VppTonemappingBrightness")

View File

@ -26,7 +26,9 @@ public struct GetProgramsDto: Codable, Hashable {
///
/// Optional.
public var enableUserData: Bool?
/// Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
/// Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options:
/// Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds,
/// PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
///
/// Optional.
public var fields: [ItemFields]?

View File

@ -16,7 +16,8 @@ public struct NetworkConfiguration: Codable, Hashable {
public var isAutoDiscoveryTracing: Bool?
/// Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at.
public var baseURL: String?
/// Gets or sets the password required to access the X.509 certificate data in the file specified by Jellyfin.Networking.Configuration.NetworkConfiguration.CertificatePath.
/// Gets or sets the password required to access the X.509 certificate data in the file specified by
/// Jellyfin.Networking.Configuration.NetworkConfiguration.CertificatePath.
public var certificatePassword: String?
/// Gets or sets the filesystem path of an X.509 certificate to use for SSL.
public var certificatePath: String?
@ -46,9 +47,11 @@ public struct NetworkConfiguration: Codable, Hashable {
public var httpserverPortNumber: Int?
/// Gets or sets the HTTPS server port number.
public var httpsPortNumber: Int?
/// Gets or sets a value indicating whether address names that match Jellyfin.Networking.Configuration.NetworkConfiguration.VirtualInterfaceNames should be Ignore for the purposes of binding.
/// Gets or sets a value indicating whether address names that match
/// Jellyfin.Networking.Configuration.NetworkConfiguration.VirtualInterfaceNames should be Ignore for the purposes of binding.
public var isIgnoreVirtualInterfaces: Bool?
/// Gets or sets a value indicating whether <seealso cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.RemoteIPFilter" /> contains a blacklist or a whitelist. Default is a whitelist.
/// Gets or sets a value indicating whether <seealso cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.RemoteIPFilter" />
/// contains a blacklist or a whitelist. Default is a whitelist.
public var isRemoteIPFilterBlacklist: Bool?
/// Gets or sets the known proxies. If the proxy is a network, it's added to the KnownNetworks.
public var knownProxies: [String]?
@ -64,13 +67,15 @@ public struct NetworkConfiguration: Codable, Hashable {
///
/// Gets or sets PublishedServerUri to advertise for specific subnets.
public var publishedServerUriBySubnet: [String]?
/// Gets or sets the filter for remote IP connectivity. Used in conjuntion with <seealso cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.IsRemoteIPFilterBlacklist" />.
/// Gets or sets the filter for remote IP connectivity. Used in conjuntion with <seealso
/// cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.IsRemoteIPFilterBlacklist" />.
public var remoteIPFilter: [String]?
/// Gets or sets a value indicating whether the server should force connections over HTTPS.
public var requireHTTPS: Bool?
/// Gets or sets the SSDPTracingFilter
///
/// Gets or sets a value indicating whether an IP address is to be used to filter the detailed ssdp logs that are being sent to the console/log.
/// Gets or sets a value indicating whether an IP address is to be used to filter the detailed ssdp logs that are being sent to the
/// console/log.
///
/// If the setting "Emby.Dlna": "Debug" msut be set in logging.default.json for this property to work.
public var sSDPTracingFilter: String?
@ -86,7 +91,8 @@ public struct NetworkConfiguration: Codable, Hashable {
public var uDPSendDelay: Int?
/// Gets or sets a value indicating whether the http port should be mapped as part of UPnP automatic port forwarding.
public var isUPnPCreateHTTPPortMap: Bool?
/// Gets or sets a value indicating the interfaces that should be ignored. The list can be comma separated. <seealso cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.IgnoreVirtualInterfaces" />.
/// Gets or sets a value indicating the interfaces that should be ignored. The list can be comma separated. <seealso
/// cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.IgnoreVirtualInterfaces" />.
public var virtualInterfaceNames: String?
public init(

View File

@ -51,9 +51,11 @@ public struct ServerConfiguration: Codable, Hashable {
public var libraryScanFanoutConcurrency: Int?
/// Gets or sets the number of days we should retain log files.
public var logFileRetentionDays: Int?
/// Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
/// Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed
/// playstate will be reset to the beginning and the item will be marked watched.
public var maxAudiobookResume: Int?
/// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
/// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed
/// playstate will be reset to the beginning and the item will be marked watched.
public var maxResumePct: Int?
/// Gets or sets the metadata country code.
public var metadataCountryCode: String?

View File

@ -33,9 +33,7 @@ public struct SessionInfo: Codable, Hashable, Identifiable {
public var lastActivityDate: Date?
/// Gets or sets the last playback check in.
public var lastPlaybackCheckIn: Date?
/// This is strictly used as a data transfer object from the api layer.
///
/// This holds information about a BaseItem in a format that is convenient for the client.
/// Gets or sets the now playing item.
public var nowPlayingItem: BaseItemDto?
public var nowPlayingQueue: [QueueItem]?
public var nowPlayingQueueFullItems: [BaseItemDto]?

View File

@ -52,7 +52,7 @@ public struct UserPolicy: Codable, Hashable {
public var maxParentalRating: Int?
public var passwordResetProviderID: String?
public var remoteClientBitrateLimit: Int?
/// Gets or sets a value indicating what SyncPlay features the user can access.
/// Enum SyncPlayUserAccessType.
public var syncPlayAccess: SyncPlayUserAccessType?
public init(

View File

@ -153,15 +153,6 @@ public final class JellyfinClient {
extension JellyfinClient: APIClientDelegate {
/// Allows you to modify the request right before it is sent.
/// Also injects required Jellyfin headers for every request.
///
/// Gets called right before sending the request. If the retries are enabled,
/// is called before every attempt.
///
/// - parameters:
/// - client: The client that sends the request.
/// - request: The request about to be sent. Can be modified
public func client(_ client: APIClient, willSendRequest request: inout URLRequest) async throws {
// Inject required headers
request.addValue(authHeaders(), forHTTPHeaderField: "Authorization")
@ -169,17 +160,6 @@ extension JellyfinClient: APIClientDelegate {
try await delegate?.client(_apiClient, willSendRequest: &request)
}
/// Validates response for the given request.
///
/// - parameters:
/// - client: The client that sent the request.
/// - response: The response with an invalid status code.
/// - data: Body of the response, if any.
/// - request: Failing request.
///
/// - throws: An error to be returned to the user. By default, throws
/// ``APIError/unacceptableStatusCode(_:)`` if the code is outside of
/// the `200..<300` range.
public func client(_ client: APIClient, validateResponse response: HTTPURLResponse, data: Data, task: URLSessionTask) throws {
if let delegate = delegate {
try delegate.client(_apiClient, validateResponse: response, data: data, task: task)
@ -190,34 +170,12 @@ extension JellyfinClient: APIClientDelegate {
}
}
/// Gets called after a networking failure. Only one retry attempt is allowed.
///
/// - important: This method will only be called for network requests, but not for
/// response body decoding failures or failures with creating requests using
/// ``client(_:makeURLFor:query:)`` and ``client(_:willSendRequest:)``.
///
/// - parameters:
/// - client: The client that sent the request.
/// - task: The failed task.
/// - error: The encountered error.
/// - attempts: The number of already performed attempts.
///
/// - returns: Return `true` to retry the request.
public func client(_ client: APIClient, shouldRetry task: URLSessionTask, error: Error, attempts: Int) async throws -> Bool {
try await delegate?.client(_apiClient, shouldRetry: task, error: error, attempts: attempts) ?? false
}
/// Constructs URL for the given request.
///
/// - parameters:
/// - client: The client that sends the request.
/// - url: The URL passed by the client.
/// - request: The request about to be sent.
///
/// - returns: The URL for the request. Return `nil` to use the default
/// logic used by client.
public func client(_ client: APIClient, makeURLFor url: String, query: [(String, String?)]?) throws -> URL? {
try delegate?.client(_apiClient, makeURLFor: url, query: query)
public func client<T>(_ client: APIClient, makeURLForRequest request: Request<T>) throws -> URL? {
try delegate?.client(_apiClient, makeURLForRequest: request)
}
}
@ -227,7 +185,8 @@ public extension JellyfinClient {
/// Signs in a user given a username and password. On a successful response `accessToken` is set to the given access token.
///
/// - Note: Overrides the current access token if one was previously set. Save this token locally or revoke it with `signOut` for proper access token management.
/// - Note: Overrides the current access token if one was previously set. Save this token locally or revoke it with `signOut` for proper
/// access token management.
///
/// - Parameters:
/// - username: username of the user
@ -250,7 +209,8 @@ public extension JellyfinClient {
/// Signs in a user given a Quick Connect secret.
///
/// - Note: Overrides the current access token if one was previously set. Save this token locally or revoke it with `signOut` for proper access token management.
/// - Note: Overrides the current access token if one was previously set. Save this token locally or revoke it with `signOut` for proper
/// access token management.
///
/// - Parameters:
/// - quickConnectSecret: current Quick Connect secret

View File

@ -16,7 +16,7 @@ public extension Paths {
parameters: AddListingProviderParameters? = nil,
_ body: JellyfinAPI.ListingsProviderInfo? = nil
) -> Request<JellyfinAPI.ListingsProviderInfo> {
Request(method: "POST", url: "/LiveTv/ListingProviders", query: parameters?.asQuery, body: body, id: "AddListingProvider")
Request(path: "/LiveTv/ListingProviders", method: "POST", query: parameters?.asQuery, body: body, id: "AddListingProvider")
}
struct AddListingProviderParameters {

View File

@ -14,8 +14,8 @@ extension Paths {
/// Add a media path to a library.
public static func addMediaPath(isRefreshLibrary: Bool? = nil, _ body: JellyfinAPI.MediaPathDto) -> Request<Void> {
Request(
path: "/Library/VirtualFolders/Paths",
method: "POST",
url: "/Library/VirtualFolders/Paths",
query: makeAddMediaPathQuery(isRefreshLibrary),
body: body,
id: "AddMediaPath"

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Adds items to a collection.
public static func addToCollection(collectionID: String, ids: [String]) -> Request<Void> {
Request(method: "POST", url: "/Collections/\(collectionID)/Items", query: makeAddToCollectionQuery(ids), id: "AddToCollection")
Request(path: "/Collections/\(collectionID)/Items", method: "POST", query: makeAddToCollectionQuery(ids), id: "AddToCollection")
}
private static func makeAddToCollectionQuery(_ ids: [String]) -> [(String, String?)] {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Adds items to a playlist.
public static func addToPlaylist(playlistID: String, ids: [String]? = nil, userID: String? = nil) -> Request<Void> {
Request(method: "POST", url: "/Playlists/\(playlistID)/Items", query: makeAddToPlaylistQuery(ids, userID), id: "AddToPlaylist")
Request(path: "/Playlists/\(playlistID)/Items", method: "POST", query: makeAddToPlaylistQuery(ids, userID), id: "AddToPlaylist")
}
private static func makeAddToPlaylistQuery(_ ids: [String]?, _ userID: String?) -> [(String, String?)] {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Adds a tuner host.
static func addTunerHost(_ body: JellyfinAPI.TunerHostInfo? = nil) -> Request<JellyfinAPI.TunerHostInfo> {
Request(method: "POST", url: "/LiveTv/TunerHosts", body: body, id: "AddTunerHost")
Request(path: "/LiveTv/TunerHosts", method: "POST", body: body, id: "AddTunerHost")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Adds an additional user to a session.
static func addUserToSession(sessionID: String, userID: String) -> Request<Void> {
Request(method: "POST", url: "/Sessions/\(sessionID)/User/\(userID)", id: "AddUserToSession")
Request(path: "/Sessions/\(sessionID)/User/\(userID)", method: "POST", id: "AddUserToSession")
}
}

View File

@ -16,7 +16,7 @@ public extension Paths {
parameters: AddVirtualFolderParameters? = nil,
_ body: JellyfinAPI.AddVirtualFolderDto? = nil
) -> Request<Void> {
Request(method: "POST", url: "/Library/VirtualFolders", query: parameters?.asQuery, body: body, id: "AddVirtualFolder")
Request(path: "/Library/VirtualFolders", method: "POST", query: parameters?.asQuery, body: body, id: "AddVirtualFolder")
}
struct AddVirtualFolderParameters {

View File

@ -18,8 +18,8 @@ extension Paths {
_ body: JellyfinAPI.RemoteSearchResult
) -> Request<Void> {
Request(
path: "/Items/RemoteSearch/Apply/\(itemID)",
method: "POST",
url: "/Items/RemoteSearch/Apply/\(itemID)",
query: makeApplySearchCriteriaQuery(isReplaceAllImages),
body: body,
id: "ApplySearchCriteria"

View File

@ -14,8 +14,8 @@ extension Paths {
/// Authenticates a user.
public static func authenticateUser(userID: String, pw: String, password: String? = nil) -> Request<JellyfinAPI.AuthenticationResult> {
Request(
path: "/Users/\(userID)/Authenticate",
method: "POST",
url: "/Users/\(userID)/Authenticate",
query: makeAuthenticateUserQuery(pw, password),
id: "AuthenticateUser"
)

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Authenticates a user by name.
static func authenticateUserByName(_ body: JellyfinAPI.AuthenticateUserByName) -> Request<JellyfinAPI.AuthenticationResult> {
Request(method: "POST", url: "/Users/AuthenticateByName", body: body, id: "AuthenticateUserByName")
Request(path: "/Users/AuthenticateByName", method: "POST", body: body, id: "AuthenticateUserByName")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Authenticates a user with quick connect.
static func authenticateWithQuickConnect(_ body: JellyfinAPI.QuickConnectDto) -> Request<JellyfinAPI.AuthenticationResult> {
Request(method: "POST", url: "/Users/AuthenticateWithQuickConnect", body: body, id: "AuthenticateWithQuickConnect")
Request(path: "/Users/AuthenticateWithQuickConnect", method: "POST", body: body, id: "AuthenticateWithQuickConnect")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Authorizes a pending quick connect request.
static func authorize(code: String) -> Request<Data> {
Request(method: "POST", url: "/QuickConnect/Authorize", query: [("code", code)], id: "Authorize")
Request(path: "/QuickConnect/Authorize", method: "POST", query: [("code", code)], id: "Authorize")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Cancels a package installation.
static func cancelPackageInstallation(packageID: String) -> Request<Void> {
Request(method: "DELETE", url: "/Packages/Installing/\(packageID)", id: "CancelPackageInstallation")
Request(path: "/Packages/Installing/\(packageID)", method: "DELETE", id: "CancelPackageInstallation")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Cancels a live tv series timer.
static func cancelSeriesTimer(timerID: String) -> Request<Void> {
Request(method: "DELETE", url: "/LiveTv/SeriesTimers/\(timerID)", id: "CancelSeriesTimer")
Request(path: "/LiveTv/SeriesTimers/\(timerID)", method: "DELETE", id: "CancelSeriesTimer")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Cancels a live tv timer.
static func cancelTimer(timerID: String) -> Request<Void> {
Request(method: "DELETE", url: "/LiveTv/Timers/\(timerID)", id: "CancelTimer")
Request(path: "/LiveTv/Timers/\(timerID)", method: "DELETE", id: "CancelTimer")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Closes a media source.
static func closeLiveStream(liveStreamID: String) -> Request<Void> {
Request(method: "POST", url: "/LiveStreams/Close", query: [("liveStreamId", liveStreamID)], id: "CloseLiveStream")
Request(path: "/LiveStreams/Close", method: "POST", query: [("liveStreamId", liveStreamID)], id: "CloseLiveStream")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Completes the startup wizard.
static var completeWizard: Request<Void> {
Request(method: "POST", url: "/Startup/Complete", id: "CompleteWizard")
Request(path: "/Startup/Complete", method: "POST", id: "CompleteWizard")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Attempts to retrieve authentication information.
static func connect(secret: String) -> Request<JellyfinAPI.QuickConnectResult> {
Request(method: "GET", url: "/QuickConnect/Connect", query: [("secret", secret)], id: "Connect")
Request(path: "/QuickConnect/Connect", method: "GET", query: [("secret", secret)], id: "Connect")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Sends a notification to all admins.
static func createAdminNotification(_ body: JellyfinAPI.AdminNotificationDto) -> Request<Void> {
Request(method: "POST", url: "/Notifications/Admin", body: body, id: "CreateAdminNotification")
Request(path: "/Notifications/Admin", method: "POST", body: body, id: "CreateAdminNotification")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Creates a new collection.
static func createCollection(parameters: CreateCollectionParameters? = nil) -> Request<JellyfinAPI.CollectionCreationResult> {
Request(method: "POST", url: "/Collections", query: parameters?.asQuery, id: "CreateCollection")
Request(path: "/Collections", method: "POST", query: parameters?.asQuery, id: "CreateCollection")
}
struct CreateCollectionParameters {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Create a new api key.
static func createKey(app: String) -> Request<Void> {
Request(method: "POST", url: "/Auth/Keys", query: [("app", app)], id: "CreateKey")
Request(path: "/Auth/Keys", method: "POST", query: [("app", app)], id: "CreateKey")
}
}

View File

@ -20,7 +20,7 @@ public extension Paths {
parameters: CreatePlaylistParameters? = nil,
_ body: JellyfinAPI.CreatePlaylistDto? = nil
) -> Request<JellyfinAPI.PlaylistCreationResult> {
Request(method: "POST", url: "/Playlists", query: parameters?.asQuery, body: body, id: "CreatePlaylist")
Request(path: "/Playlists", method: "POST", query: parameters?.asQuery, body: body, id: "CreatePlaylist")
}
struct CreatePlaylistParameters {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Creates a profile.
static func createProfile(_ body: JellyfinAPI.DeviceProfile? = nil) -> Request<Void> {
Request(method: "POST", url: "/Dlna/Profiles", body: body, id: "CreateProfile")
Request(path: "/Dlna/Profiles", method: "POST", body: body, id: "CreateProfile")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Creates a live tv series timer.
static func createSeriesTimer(_ body: JellyfinAPI.SeriesTimerInfoDto? = nil) -> Request<Void> {
Request(method: "POST", url: "/LiveTv/SeriesTimers", body: body, id: "CreateSeriesTimer")
Request(path: "/LiveTv/SeriesTimers", method: "POST", body: body, id: "CreateSeriesTimer")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Creates a live tv timer.
static func createTimer(_ body: JellyfinAPI.TimerInfoDto? = nil) -> Request<Void> {
Request(method: "POST", url: "/LiveTv/Timers", body: body, id: "CreateTimer")
Request(path: "/LiveTv/Timers", method: "POST", body: body, id: "CreateTimer")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Creates a user.
static func createUserByName(_ body: JellyfinAPI.CreateUserByName) -> Request<JellyfinAPI.UserDto> {
Request(method: "POST", url: "/Users/New", body: body, id: "CreateUserByName")
Request(path: "/Users/New", method: "POST", body: body, id: "CreateUserByName")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Removes alternate video sources.
static func deleteAlternateSources(itemID: String) -> Request<Void> {
Request(method: "DELETE", url: "/Videos/\(itemID)/AlternateSources", id: "DeleteAlternateSources")
Request(path: "/Videos/\(itemID)/AlternateSources", method: "DELETE", id: "DeleteAlternateSources")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Delete a custom splashscreen.
static var deleteCustomSplashscreen: Request<Void> {
Request(method: "DELETE", url: "/Branding/Splashscreen", id: "DeleteCustomSplashscreen")
Request(path: "/Branding/Splashscreen", method: "DELETE", id: "DeleteCustomSplashscreen")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Deletes a device.
static func deleteDevice(id: String) -> Request<Void> {
Request(method: "DELETE", url: "/Devices", query: [("id", id)], id: "DeleteDevice")
Request(path: "/Devices", method: "DELETE", query: [("id", id)], id: "DeleteDevice")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Deletes an item from the library and filesystem.
static func deleteItem(itemID: String) -> Request<Void> {
Request(method: "DELETE", url: "/Items/\(itemID)", id: "DeleteItem")
Request(path: "/Items/\(itemID)", method: "DELETE", id: "DeleteItem")
}
}

View File

@ -14,8 +14,8 @@ extension Paths {
/// Delete an item's image.
public static func deleteItemImage(itemID: String, imageType: String, imageIndex: Int? = nil) -> Request<Void> {
Request(
path: "/Items/\(itemID)/Images/\(imageType)",
method: "DELETE",
url: "/Items/\(itemID)/Images/\(imageType)",
query: makeDeleteItemImageQuery(imageIndex),
id: "DeleteItemImage"
)

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Delete an item's image.
static func deleteItemImageByIndex(itemID: String, imageType: String, imageIndex: Int) -> Request<Void> {
Request(method: "DELETE", url: "/Items/\(itemID)/Images/\(imageType)/\(imageIndex)", id: "DeleteItemImageByIndex")
Request(path: "/Items/\(itemID)/Images/\(imageType)/\(imageIndex)", method: "DELETE", id: "DeleteItemImageByIndex")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Deletes items from the library and filesystem.
public static func deleteItems(ids: [String]? = nil) -> Request<Void> {
Request(method: "DELETE", url: "/Items", query: makeDeleteItemsQuery(ids), id: "DeleteItems")
Request(path: "/Items", method: "DELETE", query: makeDeleteItemsQuery(ids), id: "DeleteItems")
}
private static func makeDeleteItemsQuery(_ ids: [String]?) -> [(String, String?)] {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Delete listing provider.
public static func deleteListingProvider(id: String? = nil) -> Request<Void> {
Request(method: "DELETE", url: "/LiveTv/ListingProviders", query: makeDeleteListingProviderQuery(id), id: "DeleteListingProvider")
Request(path: "/LiveTv/ListingProviders", method: "DELETE", query: makeDeleteListingProviderQuery(id), id: "DeleteListingProvider")
}
private static func makeDeleteListingProviderQuery(_ id: String?) -> [(String, String?)] {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Deletes a profile.
static func deleteProfile(profileID: String) -> Request<Void> {
Request(method: "DELETE", url: "/Dlna/Profiles/\(profileID)", id: "DeleteProfile")
Request(path: "/Dlna/Profiles/\(profileID)", method: "DELETE", id: "DeleteProfile")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Deletes a live tv recording.
static func deleteRecording(recordingID: String) -> Request<Void> {
Request(method: "DELETE", url: "/LiveTv/Recordings/\(recordingID)", id: "DeleteRecording")
Request(path: "/LiveTv/Recordings/\(recordingID)", method: "DELETE", id: "DeleteRecording")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Deletes an external subtitle file.
static func deleteSubtitle(itemID: String, index: Int) -> Request<Void> {
Request(method: "DELETE", url: "/Videos/\(itemID)/Subtitles/\(index)", id: "DeleteSubtitle")
Request(path: "/Videos/\(itemID)/Subtitles/\(index)", method: "DELETE", id: "DeleteSubtitle")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Deletes a tuner host.
public static func deleteTunerHost(id: String? = nil) -> Request<Void> {
Request(method: "DELETE", url: "/LiveTv/TunerHosts", query: makeDeleteTunerHostQuery(id), id: "DeleteTunerHost")
Request(path: "/LiveTv/TunerHosts", method: "DELETE", query: makeDeleteTunerHostQuery(id), id: "DeleteTunerHost")
}
private static func makeDeleteTunerHostQuery(_ id: String?) -> [(String, String?)] {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Deletes a user.
static func deleteUser(userID: String) -> Request<Void> {
Request(method: "DELETE", url: "/Users/\(userID)", id: "DeleteUser")
Request(path: "/Users/\(userID)", method: "DELETE", id: "DeleteUser")
}
}

View File

@ -14,8 +14,8 @@ extension Paths {
/// Delete the user's image.
public static func deleteUserImage(userID: String, imageType: String, index: Int? = nil) -> Request<Void> {
Request(
path: "/Users/\(userID)/Images/\(imageType)",
method: "DELETE",
url: "/Users/\(userID)/Images/\(imageType)",
query: makeDeleteUserImageQuery(index),
id: "DeleteUserImage"
)

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Delete the user's image.
static func deleteUserImageByIndex(userID: String, imageType: String, index: Int) -> Request<Void> {
Request(method: "DELETE", url: "/Users/\(userID)/Images/\(imageType)/\(index)", id: "DeleteUserImageByIndex")
Request(path: "/Users/\(userID)/Images/\(imageType)/\(index)", method: "DELETE", id: "DeleteUserImageByIndex")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Deletes a user's saved personal rating for an item.
static func deleteUserItemRating(userID: String, itemID: String) -> Request<JellyfinAPI.UserItemDataDto> {
Request(method: "DELETE", url: "/Users/\(userID)/Items/\(itemID)/Rating", id: "DeleteUserItemRating")
Request(path: "/Users/\(userID)/Items/\(itemID)/Rating", method: "DELETE", id: "DeleteUserItemRating")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Disable a plugin.
static func disablePlugin(pluginID: String, version: String) -> Request<Void> {
Request(method: "POST", url: "/Plugins/\(pluginID)/\(version)/Disable", id: "DisablePlugin")
Request(path: "/Plugins/\(pluginID)/\(version)/Disable", method: "POST", id: "DisablePlugin")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Discover tuners.
public static func discoverTuners(isNewDevicesOnly: Bool? = nil) -> Request<[JellyfinAPI.TunerHostInfo]> {
Request(method: "GET", url: "/LiveTv/Tuners/Discover", query: makeDiscoverTunersQuery(isNewDevicesOnly), id: "DiscoverTuners")
Request(path: "/LiveTv/Tuners/Discover", method: "GET", query: makeDiscoverTunersQuery(isNewDevicesOnly), id: "DiscoverTuners")
}
private static func makeDiscoverTunersQuery(_ isNewDevicesOnly: Bool?) -> [(String, String?)] {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Discover tuners.
public static func discvoverTuners(isNewDevicesOnly: Bool? = nil) -> Request<[JellyfinAPI.TunerHostInfo]> {
Request(method: "GET", url: "/LiveTv/Tuners/Discvover", query: makeDiscvoverTunersQuery(isNewDevicesOnly), id: "DiscvoverTuners")
Request(path: "/LiveTv/Tuners/Discvover", method: "GET", query: makeDiscvoverTunersQuery(isNewDevicesOnly), id: "DiscvoverTuners")
}
private static func makeDiscvoverTunersQuery(_ isNewDevicesOnly: Bool?) -> [(String, String?)] {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Instructs a session to browse to an item or view.
static func displayContent(sessionID: String, parameters: DisplayContentParameters) -> Request<Void> {
Request(method: "POST", url: "/Sessions/\(sessionID)/Viewing", query: parameters.asQuery, id: "DisplayContent")
Request(path: "/Sessions/\(sessionID)/Viewing", method: "POST", query: parameters.asQuery, id: "DisplayContent")
}
struct DisplayContentParameters {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Downloads a remote image for an item.
static func downloadRemoteImage(itemID: String, parameters: DownloadRemoteImageParameters) -> Request<Void> {
Request(method: "POST", url: "/Items/\(itemID)/RemoteImages/Download", query: parameters.asQuery, id: "DownloadRemoteImage")
Request(path: "/Items/\(itemID)/RemoteImages/Download", method: "POST", query: parameters.asQuery, id: "DownloadRemoteImage")
}
struct DownloadRemoteImageParameters {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Downloads a remote subtitle.
static func downloadRemoteSubtitles(itemID: String, subtitleID: String) -> Request<Void> {
Request(method: "POST", url: "/Items/\(itemID)/RemoteSearch/Subtitles/\(subtitleID)", id: "DownloadRemoteSubtitles")
Request(path: "/Items/\(itemID)/RemoteSearch/Subtitles/\(subtitleID)", method: "POST", id: "DownloadRemoteSubtitles")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Enables a disabled plugin.
static func enablePlugin(pluginID: String, version: String) -> Request<Void> {
Request(method: "POST", url: "/Plugins/\(pluginID)/\(version)/Enable", id: "EnablePlugin")
Request(path: "/Plugins/\(pluginID)/\(version)/Enable", method: "POST", id: "EnablePlugin")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Initiates the forgot password process for a local user.
static func forgotPassword(_ body: JellyfinAPI.ForgotPasswordDto) -> Request<JellyfinAPI.ForgotPasswordResult> {
Request(method: "POST", url: "/Users/ForgotPassword", body: body, id: "ForgotPassword")
Request(path: "/Users/ForgotPassword", method: "POST", body: body, id: "ForgotPassword")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Redeems a forgot password pin.
static func forgotPasswordPin(_ body: JellyfinAPI.ForgotPasswordPinDto) -> Request<JellyfinAPI.PinRedeemResult> {
Request(method: "POST", url: "/Users/ForgotPassword/Pin", body: body, id: "ForgotPasswordPin")
Request(path: "/Users/ForgotPassword/Pin", method: "POST", body: body, id: "ForgotPasswordPin")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Gets the search hint result.
static func get(parameters: GetParameters) -> Request<JellyfinAPI.SearchHintResult> {
Request(method: "GET", url: "/Search/Hints", query: parameters.asQuery, id: "Get")
Request(path: "/Search/Hints", method: "GET", query: parameters.asQuery, id: "Get")
}
struct GetParameters {

View File

@ -13,7 +13,12 @@ import URLQueryEncoder
extension Paths {
/// Gets additional parts for a video.
public static func getAdditionalPart(itemID: String, userID: String? = nil) -> Request<JellyfinAPI.BaseItemDtoQueryResult> {
Request(method: "GET", url: "/Videos/\(itemID)/AdditionalParts", query: makeGetAdditionalPartQuery(userID), id: "GetAdditionalPart")
Request(
path: "/Videos/\(itemID)/AdditionalParts",
method: "GET",
query: makeGetAdditionalPartQuery(userID),
id: "GetAdditionalPart"
)
}
private static func makeGetAdditionalPartQuery(_ userID: String?) -> [(String, String?)] {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Gets all album artists from a given item, folder, or the entire library.
static func getAlbumArtists(parameters: GetAlbumArtistsParameters? = nil) -> Request<JellyfinAPI.BaseItemDtoQueryResult> {
Request(method: "GET", url: "/Artists/AlbumArtists", query: parameters?.asQuery, id: "GetAlbumArtists")
Request(path: "/Artists/AlbumArtists", method: "GET", query: parameters?.asQuery, id: "GetAlbumArtists")
}
struct GetAlbumArtistsParameters {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Get all channel features.
static var getAllChannelFeatures: Request<[JellyfinAPI.ChannelFeatures]> {
Request(method: "GET", url: "/Channels/Features", id: "GetAllChannelFeatures")
Request(path: "/Channels/Features", method: "GET", id: "GetAllChannelFeatures")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Gets all parents of an item.
public static func getAncestors(itemID: String, userID: String? = nil) -> Request<[JellyfinAPI.BaseItemDto]> {
Request(method: "GET", url: "/Items/\(itemID)/Ancestors", query: makeGetAncestorsQuery(userID), id: "GetAncestors")
Request(path: "/Items/\(itemID)/Ancestors", method: "GET", query: makeGetAncestorsQuery(userID), id: "GetAncestors")
}
private static func makeGetAncestorsQuery(_ userID: String?) -> [(String, String?)] {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Gets an artist by name.
public static func getArtistByName(name: String, userID: String? = nil) -> Request<JellyfinAPI.BaseItemDto> {
Request(method: "GET", url: "/Artists/\(name)", query: makeGetArtistByNameQuery(userID), id: "GetArtistByName")
Request(path: "/Artists/\(name)", method: "GET", query: makeGetArtistByNameQuery(userID), id: "GetArtistByName")
}
private static func makeGetArtistByNameQuery(_ userID: String?) -> [(String, String?)] {

View File

@ -18,7 +18,7 @@ public extension Paths {
imageIndex: Int,
parameters: GetArtistImageParameters? = nil
) -> Request<Data> {
Request(method: "GET", url: "/Artists/\(name)/Images/\(imageType)/\(imageIndex)", query: parameters?.asQuery, id: "GetArtistImage")
Request(path: "/Artists/\(name)/Images/\(imageType)/\(imageIndex)", method: "GET", query: parameters?.asQuery, id: "GetArtistImage")
}
struct GetArtistImageParameters {

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Gets all artists from a given item, folder, or the entire library.
static func getArtists(parameters: GetArtistsParameters? = nil) -> Request<JellyfinAPI.BaseItemDtoQueryResult> {
Request(method: "GET", url: "/Artists", query: parameters?.asQuery, id: "GetArtists")
Request(path: "/Artists", method: "GET", query: parameters?.asQuery, id: "GetArtists")
}
struct GetArtistsParameters {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Get video attachment.
static func getAttachment(videoID: String, mediaSourceID: String, index: Int) -> Request<Data> {
Request(method: "GET", url: "/Videos/\(videoID)/\(mediaSourceID)/Attachments/\(index)", id: "GetAttachment")
Request(path: "/Videos/\(videoID)/\(mediaSourceID)/Attachments/\(index)", method: "GET", id: "GetAttachment")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Gets an audio stream.
static func getAudioStream(itemID: String, parameters: GetAudioStreamParameters? = nil) -> Request<Data> {
Request(method: "GET", url: "/Audio/\(itemID)/stream", query: parameters?.asQuery, id: "GetAudioStream")
Request(path: "/Audio/\(itemID)/stream", method: "GET", query: parameters?.asQuery, id: "GetAudioStream")
}
struct GetAudioStreamParameters {

View File

@ -17,7 +17,7 @@ public extension Paths {
container: String,
parameters: GetAudioStreamByContainerParameters? = nil
) -> Request<Data> {
Request(method: "GET", url: "/Audio/\(itemID)/stream.\(container)", query: parameters?.asQuery, id: "GetAudioStreamByContainer")
Request(path: "/Audio/\(itemID)/stream.\(container)", method: "GET", query: parameters?.asQuery, id: "GetAudioStreamByContainer")
}
struct GetAudioStreamByContainerParameters {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Get all auth providers.
static var getAuthProviders: Request<[JellyfinAPI.NameIDPair]> {
Request(method: "GET", url: "/Auth/Providers", id: "GetAuthProviders")
Request(path: "/Auth/Providers", method: "GET", id: "GetAuthProviders")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Tests the network with a request with the size of the bitrate.
public static func getBitrateTestBytes(size: Int? = nil) -> Request<Data> {
Request(method: "GET", url: "/Playback/BitrateTest", query: makeGetBitrateTestBytesQuery(size), id: "GetBitrateTestBytes")
Request(path: "/Playback/BitrateTest", method: "GET", query: makeGetBitrateTestBytesQuery(size), id: "GetBitrateTestBytes")
}
private static func makeGetBitrateTestBytesQuery(_ size: Int?) -> [(String, String?)] {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Get book remote search.
static func getBookRemoteSearchResults(_ body: JellyfinAPI.BookInfoRemoteSearchQuery) -> Request<[JellyfinAPI.RemoteSearchResult]> {
Request(method: "POST", url: "/Items/RemoteSearch/Book", body: body, id: "GetBookRemoteSearchResults")
Request(path: "/Items/RemoteSearch/Book", method: "POST", body: body, id: "GetBookRemoteSearchResults")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Get box set remote search.
static func getBoxSetRemoteSearchResults(_ body: JellyfinAPI.BoxSetInfoRemoteSearchQuery) -> Request<[JellyfinAPI.RemoteSearchResult]> {
Request(method: "POST", url: "/Items/RemoteSearch/BoxSet", body: body, id: "GetBoxSetRemoteSearchResults")
Request(path: "/Items/RemoteSearch/BoxSet", method: "POST", body: body, id: "GetBoxSetRemoteSearchResults")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets branding css.
static var getBrandingCss2: Request<String> {
Request(method: "GET", url: "/Branding/Css.css", id: "GetBrandingCss_2")
Request(path: "/Branding/Css.css", method: "GET", id: "GetBrandingCss_2")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets branding css.
static var getBrandingCss: Request<String> {
Request(method: "GET", url: "/Branding/Css", id: "GetBrandingCss")
Request(path: "/Branding/Css", method: "GET", id: "GetBrandingCss")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets branding configuration.
static var getBrandingOptions: Request<JellyfinAPI.BrandingOptions> {
Request(method: "GET", url: "/Branding/Configuration", id: "GetBrandingOptions")
Request(path: "/Branding/Configuration", method: "GET", id: "GetBrandingOptions")
}
}

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
extension Paths {
/// Gets a live tv channel.
public static func getChannel(channelID: String, userID: String? = nil) -> Request<JellyfinAPI.BaseItemDto> {
Request(method: "GET", url: "/LiveTv/Channels/\(channelID)", query: makeGetChannelQuery(userID), id: "GetChannel")
Request(path: "/LiveTv/Channels/\(channelID)", method: "GET", query: makeGetChannelQuery(userID), id: "GetChannel")
}
private static func makeGetChannelQuery(_ userID: String?) -> [(String, String?)] {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Get channel features.
static func getChannelFeatures(channelID: String) -> Request<JellyfinAPI.ChannelFeatures> {
Request(method: "GET", url: "/Channels/\(channelID)/Features", id: "GetChannelFeatures")
Request(path: "/Channels/\(channelID)/Features", method: "GET", id: "GetChannelFeatures")
}
}

View File

@ -16,7 +16,7 @@ public extension Paths {
channelID: String,
parameters: GetChannelItemsParameters? = nil
) -> Request<JellyfinAPI.BaseItemDtoQueryResult> {
Request(method: "GET", url: "/Channels/\(channelID)/Items", query: parameters?.asQuery, id: "GetChannelItems")
Request(path: "/Channels/\(channelID)/Items", method: "GET", query: parameters?.asQuery, id: "GetChannelItems")
}
struct GetChannelItemsParameters {

View File

@ -14,8 +14,8 @@ extension Paths {
/// Get channel mapping options.
public static func getChannelMappingOptions(providerID: String? = nil) -> Request<JellyfinAPI.ChannelMappingOptionsDto> {
Request(
path: "/LiveTv/ChannelMappingOptions",
method: "GET",
url: "/LiveTv/ChannelMappingOptions",
query: makeGetChannelMappingOptionsQuery(providerID),
id: "GetChannelMappingOptions"
)

View File

@ -13,7 +13,7 @@ import URLQueryEncoder
public extension Paths {
/// Gets available channels.
static func getChannels(parameters: GetChannelsParameters? = nil) -> Request<JellyfinAPI.BaseItemDtoQueryResult> {
Request(method: "GET", url: "/Channels", query: parameters?.asQuery, id: "GetChannels")
Request(path: "/Channels", method: "GET", query: parameters?.asQuery, id: "GetChannels")
}
struct GetChannelsParameters {

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets application configuration.
static var getConfiguration: Request<JellyfinAPI.ServerConfiguration> {
Request(method: "GET", url: "/System/Configuration", id: "GetConfiguration")
Request(path: "/System/Configuration", method: "GET", id: "GetConfiguration")
}
}

View File

@ -14,8 +14,8 @@ extension Paths {
/// Gets the configuration pages.
public static func getConfigurationPages(enableInMainMenu: Bool? = nil) -> Request<[JellyfinAPI.ConfigurationPageInfo]> {
Request(
path: "/web/ConfigurationPages",
method: "GET",
url: "/web/ConfigurationPages",
query: makeGetConfigurationPagesQuery(enableInMainMenu),
id: "GetConfigurationPages"
)

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets Dlna media receiver registrar xml.
static func getConnectionManager2(serverID: String) -> Request<String> {
Request(method: "GET", url: "/Dlna/\(serverID)/ConnectionManager/ConnectionManager", id: "GetConnectionManager_2")
Request(path: "/Dlna/\(serverID)/ConnectionManager/ConnectionManager", method: "GET", id: "GetConnectionManager_2")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets Dlna media receiver registrar xml.
static func getConnectionManager3(serverID: String) -> Request<String> {
Request(method: "GET", url: "/Dlna/\(serverID)/ConnectionManager/ConnectionManager.xml", id: "GetConnectionManager_3")
Request(path: "/Dlna/\(serverID)/ConnectionManager/ConnectionManager.xml", method: "GET", id: "GetConnectionManager_3")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets Dlna media receiver registrar xml.
static func getConnectionManager(serverID: String) -> Request<String> {
Request(method: "GET", url: "/Dlna/\(serverID)/ConnectionManager", id: "GetConnectionManager")
Request(path: "/Dlna/\(serverID)/ConnectionManager", method: "GET", id: "GetConnectionManager")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets Dlna content directory xml.
static func getContentDirectory2(serverID: String) -> Request<String> {
Request(method: "GET", url: "/Dlna/\(serverID)/ContentDirectory/ContentDirectory", id: "GetContentDirectory_2")
Request(path: "/Dlna/\(serverID)/ContentDirectory/ContentDirectory", method: "GET", id: "GetContentDirectory_2")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets Dlna content directory xml.
static func getContentDirectory3(serverID: String) -> Request<String> {
Request(method: "GET", url: "/Dlna/\(serverID)/ContentDirectory/ContentDirectory.xml", id: "GetContentDirectory_3")
Request(path: "/Dlna/\(serverID)/ContentDirectory/ContentDirectory.xml", method: "GET", id: "GetContentDirectory_3")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets Dlna content directory xml.
static func getContentDirectory(serverID: String) -> Request<String> {
Request(method: "GET", url: "/Dlna/\(serverID)/ContentDirectory", id: "GetContentDirectory")
Request(path: "/Dlna/\(serverID)/ContentDirectory", method: "GET", id: "GetContentDirectory")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets known countries.
static var getCountries: Request<[JellyfinAPI.CountryInfo]> {
Request(method: "GET", url: "/Localization/Countries", id: "GetCountries")
Request(path: "/Localization/Countries", method: "GET", id: "GetCountries")
}
}

View File

@ -14,6 +14,6 @@ public extension Paths {
/// Gets critic review for an item.
@available(*, deprecated, message: "Deprecated")
static func getCriticReviews(itemID: String) -> Request<JellyfinAPI.BaseItemDtoQueryResult> {
Request(method: "GET", url: "/Items/\(itemID)/CriticReviews", id: "GetCriticReviews")
Request(path: "/Items/\(itemID)/CriticReviews", method: "GET", id: "GetCriticReviews")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets known cultures.
static var getCultures: Request<[JellyfinAPI.CultureDto]> {
Request(method: "GET", url: "/Localization/Cultures", id: "GetCultures")
Request(path: "/Localization/Cultures", method: "GET", id: "GetCultures")
}
}

View File

@ -13,6 +13,6 @@ import URLQueryEncoder
public extension Paths {
/// Gets the user based on auth token.
static var getCurrentUser: Request<JellyfinAPI.UserDto> {
Request(method: "GET", url: "/Users/Me", id: "GetCurrentUser")
Request(path: "/Users/Me", method: "GET", id: "GetCurrentUser")
}
}

View File

@ -14,8 +14,8 @@ extension Paths {
/// Gets a dashboard configuration page.
public static func getDashboardConfigurationPage(name: String? = nil) -> Request<String> {
Request(
path: "/web/ConfigurationPage",
method: "GET",
url: "/web/ConfigurationPage",
query: makeGetDashboardConfigurationPageQuery(name),
id: "GetDashboardConfigurationPage"
)

Some files were not shown because too many files have changed in this diff Show More