Skip to content

Commit e7bb3b7

Browse files
JPKribsLePips
andauthored
10.11 (#49)
* Generate on 10.11 * dovi vs dOVI * Remove `TaskTriggerType` in favor of `TaskTriggerInfoType`. Comment out now unused Patchwork. * Take 2 * Typo * Re-run with new hdr10Plus fix * wip --------- Co-authored-by: Ethan Pippin <ethanpippin2343@gmail.com>
1 parent 3033d73 commit e7bb3b7

88 files changed

Lines changed: 12537 additions & 1436 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Plugins/CreateAPI/GeneratePlugin.swift

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ struct Plugin: CommandPlugin {
1818
func performCommand(context: PluginContext, arguments: [String]) async throws {
1919

2020
// Apply schema pre patches
21-
try await patchTaskTriggerInfoSchema(context: context)
2221

2322
try await generate(context: context)
2423

@@ -27,9 +26,6 @@ struct Plugin: CommandPlugin {
2726
try await patchAnyJSON(context: context)
2827
try await patchGroupUpdateDiscriminator(context: context)
2928

30-
// Move patch files
31-
try await addTaskTriggerType(context: context)
32-
3329
// Create the version SDK
3430
try await generateVersionFile(context: context)
3531

@@ -107,30 +103,9 @@ struct Plugin: CommandPlugin {
107103
.directory
108104
.appending(["Sources", "jellyfin-openapi-stable-patched.json"])
109105

110-
try FileManager.default.removeItem(atPath: filePath.string)
111-
}
112-
113-
private func patchTaskTriggerInfoSchema(context: PluginContext) async throws {
114-
let contents = try await parseOriginalSchema(context: context)
115-
116-
guard case var .object(file) = contents else { return }
117-
guard case var .object(components) = file["components"] else { return }
118-
guard case var .object(schemas) = components["schemas"] else { return }
119-
guard case var .object(taskTriggerInfo) = schemas["TaskTriggerInfo"] else { return }
120-
guard case var .object(properties) = taskTriggerInfo["properties"] else { return }
121-
122-
properties["Type"] = AnyJSON.object([
123-
"type": .string("string"),
124-
"format": .string("TaskTriggerType"),
125-
"nullable": .bool(true),
126-
])
127-
128-
taskTriggerInfo["properties"] = .object(properties)
129-
schemas["TaskTriggerInfo"] = .object(taskTriggerInfo)
130-
components["schemas"] = .object(schemas)
131-
file["components"] = .object(components)
132-
133-
try await savePatchedSchema(context: context, json: .object(file))
106+
if FileManager.default.fileExists(atPath: filePath.string) {
107+
try FileManager.default.removeItem(atPath: filePath.string)
108+
}
134109
}
135110

136111
// Entities/RemoteSearchResult.swift: remove `Hashable`
@@ -173,26 +148,6 @@ struct Plugin: CommandPlugin {
173148
.write(to: URL(fileURLWithPath: filePath.string))
174149
}
175150

176-
private func addTaskTriggerType(context: PluginContext) async throws {
177-
let sourceFilePath = context
178-
.package
179-
.directory
180-
.appending(["Plugins", "CreateAPI", "PatchFiles", "TaskTriggerType.swift"])
181-
182-
let destinationFilePath = context
183-
.package
184-
.directory
185-
.appending(["Sources", "Entities", "TaskTriggerType.swift"])
186-
187-
let fileManager = FileManager.default
188-
189-
if fileManager.fileExists(atPath: destinationFilePath.string) {
190-
try fileManager.removeItem(atPath: destinationFilePath.string)
191-
}
192-
193-
try fileManager.copyItem(atPath: sourceFilePath.string, toPath: destinationFilePath.string)
194-
}
195-
196151
// TODO: Remove if/when fixed within CreateAPI
197152
// Entities/GroupUpdate.swift: change generated `Type` name to `_Type`
198153
private func patchGroupUpdateDiscriminator(context: PluginContext) async throws {
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
//
2+
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
3+
// License, v2.0. If a copy of the MPL was not distributed with this
4+
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
5+
//
6+
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors
7+
//
8+
9+
import Foundation
10+
11+
/// Manifest type for backups internal structure.
12+
public struct BackupManifestDto: Codable, Hashable {
13+
/// Gets or sets the backup engine version this backup was created with.
14+
public var backupEngineVersion: String?
15+
/// Gets or sets the date this backup was created with.
16+
public var dateCreated: Date?
17+
/// Gets or sets the contents of the backup archive.
18+
public var options: BackupOptionsDto?
19+
/// Gets or sets the path to the backup on the system.
20+
public var path: String?
21+
/// Gets or sets the jellyfin version this backup was created with.
22+
public var serverVersion: String?
23+
24+
public init(
25+
backupEngineVersion: String? = nil,
26+
dateCreated: Date? = nil,
27+
options: BackupOptionsDto? = nil,
28+
path: String? = nil,
29+
serverVersion: String? = nil
30+
) {
31+
self.backupEngineVersion = backupEngineVersion
32+
self.dateCreated = dateCreated
33+
self.options = options
34+
self.path = path
35+
self.serverVersion = serverVersion
36+
}
37+
38+
public init(from decoder: Decoder) throws {
39+
let values = try decoder.container(keyedBy: StringCodingKey.self)
40+
self.backupEngineVersion = try values.decodeIfPresent(String.self, forKey: "BackupEngineVersion")
41+
self.dateCreated = try values.decodeIfPresent(Date.self, forKey: "DateCreated")
42+
self.options = try values.decodeIfPresent(BackupOptionsDto.self, forKey: "Options")
43+
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
44+
self.serverVersion = try values.decodeIfPresent(String.self, forKey: "ServerVersion")
45+
}
46+
47+
public func encode(to encoder: Encoder) throws {
48+
var values = encoder.container(keyedBy: StringCodingKey.self)
49+
try values.encodeIfPresent(backupEngineVersion, forKey: "BackupEngineVersion")
50+
try values.encodeIfPresent(dateCreated, forKey: "DateCreated")
51+
try values.encodeIfPresent(options, forKey: "Options")
52+
try values.encodeIfPresent(path, forKey: "Path")
53+
try values.encodeIfPresent(serverVersion, forKey: "ServerVersion")
54+
}
55+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
3+
// License, v2.0. If a copy of the MPL was not distributed with this
4+
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
5+
//
6+
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors
7+
//
8+
9+
import Foundation
10+
11+
/// Defines the optional contents of the backup archive.
12+
public struct BackupOptionsDto: Codable, Hashable {
13+
/// Gets or sets a value indicating whether the archive contains the Database contents.
14+
public var isDatabase: Bool?
15+
/// Gets or sets a value indicating whether the archive contains the Metadata contents.
16+
public var isMetadata: Bool?
17+
/// Gets or sets a value indicating whether the archive contains the Subtitle contents.
18+
public var isSubtitles: Bool?
19+
/// Gets or sets a value indicating whether the archive contains the Trickplay contents.
20+
public var isTrickplay: Bool?
21+
22+
public init(isDatabase: Bool? = nil, isMetadata: Bool? = nil, isSubtitles: Bool? = nil, isTrickplay: Bool? = nil) {
23+
self.isDatabase = isDatabase
24+
self.isMetadata = isMetadata
25+
self.isSubtitles = isSubtitles
26+
self.isTrickplay = isTrickplay
27+
}
28+
29+
public init(from decoder: Decoder) throws {
30+
let values = try decoder.container(keyedBy: StringCodingKey.self)
31+
self.isDatabase = try values.decodeIfPresent(Bool.self, forKey: "Database")
32+
self.isMetadata = try values.decodeIfPresent(Bool.self, forKey: "Metadata")
33+
self.isSubtitles = try values.decodeIfPresent(Bool.self, forKey: "Subtitles")
34+
self.isTrickplay = try values.decodeIfPresent(Bool.self, forKey: "Trickplay")
35+
}
36+
37+
public func encode(to encoder: Encoder) throws {
38+
var values = encoder.container(keyedBy: StringCodingKey.self)
39+
try values.encodeIfPresent(isDatabase, forKey: "Database")
40+
try values.encodeIfPresent(isMetadata, forKey: "Metadata")
41+
try values.encodeIfPresent(isSubtitles, forKey: "Subtitles")
42+
try values.encodeIfPresent(isTrickplay, forKey: "Trickplay")
43+
}
44+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
3+
// License, v2.0. If a copy of the MPL was not distributed with this
4+
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
5+
//
6+
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors
7+
//
8+
9+
import Foundation
10+
11+
/// Defines properties used to start a restore process.
12+
public struct BackupRestoreRequestDto: Codable, Hashable {
13+
/// Gets or Sets the name of the backup archive to restore from. Must be present in
14+
/// MediaBrowser.Common.Configuration.IApplicationPaths.BackupPath.
15+
public var archiveFileName: String?
16+
17+
public init(archiveFileName: String? = nil) {
18+
self.archiveFileName = archiveFileName
19+
}
20+
21+
public init(from decoder: Decoder) throws {
22+
let values = try decoder.container(keyedBy: StringCodingKey.self)
23+
self.archiveFileName = try values.decodeIfPresent(String.self, forKey: "ArchiveFileName")
24+
}
25+
26+
public func encode(to encoder: Encoder) throws {
27+
var values = encoder.container(keyedBy: StringCodingKey.self)
28+
try values.encodeIfPresent(archiveFileName, forKey: "ArchiveFileName")
29+
}
30+
}

Sources/Entities/BaseItemDto.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public struct BaseItemDto: Codable, Hashable, Identifiable {
154154
public var mediaSources: [MediaSourceInfo]?
155155
/// Gets or sets the media streams.
156156
public var mediaStreams: [MediaStream]?
157-
/// Gets or sets the type of the media.
157+
/// Media types.
158158
public var mediaType: MediaType?
159159
/// Gets or sets the movie count.
160160
public var movieCount: Int?
@@ -272,8 +272,8 @@ public struct BaseItemDto: Codable, Hashable, Identifiable {
272272
/// Gets or sets the trailer count.
273273
public var trailerCount: Int?
274274
/// Gets or sets the trickplay manifest.
275-
public var trickplay: [String: [String: TrickplayInfo]]?
276-
/// Gets or sets the type.
275+
public var trickplay: [String: [String: TrickplayInfoDto]]?
276+
/// The base item kind.
277277
public var type: BaseItemKind?
278278
/// Gets or sets the user data for this item based on the user it's being requested for.
279279
public var userData: UserItemDataDto?
@@ -513,7 +513,7 @@ public struct BaseItemDto: Codable, Hashable, Identifiable {
513513
tags: [String]? = nil,
514514
timerID: String? = nil,
515515
trailerCount: Int? = nil,
516-
trickplay: [String: [String: TrickplayInfo]]? = nil,
516+
trickplay: [String: [String: TrickplayInfoDto]]? = nil,
517517
type: BaseItemKind? = nil,
518518
userData: UserItemDataDto? = nil,
519519
video3DFormat: Video3DFormat? = nil,
@@ -822,7 +822,7 @@ public struct BaseItemDto: Codable, Hashable, Identifiable {
822822
self.tags = try values.decodeIfPresent([String].self, forKey: "Tags")
823823
self.timerID = try values.decodeIfPresent(String.self, forKey: "TimerId")
824824
self.trailerCount = try values.decodeIfPresent(Int.self, forKey: "TrailerCount")
825-
self.trickplay = try values.decodeIfPresent([String: [String: TrickplayInfo]].self, forKey: "Trickplay")
825+
self.trickplay = try values.decodeIfPresent([String: [String: TrickplayInfoDto]].self, forKey: "Trickplay")
826826
self.type = try values.decodeIfPresent(BaseItemKind.self, forKey: "Type")
827827
self.userData = try values.decodeIfPresent(UserItemDataDto.self, forKey: "UserData")
828828
self.video3DFormat = try values.decodeIfPresent(Video3DFormat.self, forKey: "Video3DFormat")

Sources/Entities/BaseItemPerson.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct BaseItemPerson: Codable, Hashable, Identifiable {
2020
public var primaryImageTag: String?
2121
/// Gets or sets the role.
2222
public var role: String?
23-
/// Gets or sets the type.
23+
/// The person kind.
2424
public var type: PersonKind?
2525

2626
/// Gets or sets the primary image blurhash.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
3+
// License, v2.0. If a copy of the MPL was not distributed with this
4+
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
5+
//
6+
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors
7+
//
8+
9+
import Foundation
10+
11+
/// The branding options DTO for API use.
12+
///
13+
/// This DTO excludes SplashscreenLocation to prevent it from being updated via API.
14+
public struct BrandingOptionsDto: Codable, Hashable {
15+
/// Gets or sets the custom CSS.
16+
public var customCss: String?
17+
/// Gets or sets the login disclaimer.
18+
public var loginDisclaimer: String?
19+
/// Gets or sets a value indicating whether to enable the splashscreen.
20+
public var isSplashscreenEnabled: Bool?
21+
22+
public init(customCss: String? = nil, loginDisclaimer: String? = nil, isSplashscreenEnabled: Bool? = nil) {
23+
self.customCss = customCss
24+
self.loginDisclaimer = loginDisclaimer
25+
self.isSplashscreenEnabled = isSplashscreenEnabled
26+
}
27+
28+
public init(from decoder: Decoder) throws {
29+
let values = try decoder.container(keyedBy: StringCodingKey.self)
30+
self.customCss = try values.decodeIfPresent(String.self, forKey: "CustomCss")
31+
self.loginDisclaimer = try values.decodeIfPresent(String.self, forKey: "LoginDisclaimer")
32+
self.isSplashscreenEnabled = try values.decodeIfPresent(Bool.self, forKey: "SplashscreenEnabled")
33+
}
34+
35+
public func encode(to encoder: Encoder) throws {
36+
var values = encoder.container(keyedBy: StringCodingKey.self)
37+
try values.encodeIfPresent(customCss, forKey: "CustomCss")
38+
try values.encodeIfPresent(loginDisclaimer, forKey: "LoginDisclaimer")
39+
try values.encodeIfPresent(isSplashscreenEnabled, forKey: "SplashscreenEnabled")
40+
}
41+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
3+
// License, v2.0. If a copy of the MPL was not distributed with this
4+
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
5+
//
6+
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors
7+
//
8+
9+
import Foundation
10+
11+
/// The custom value option for custom database providers.
12+
public struct CustomDatabaseOption: Codable, Hashable {
13+
/// Gets or sets the key of the value.
14+
public var key: String?
15+
/// Gets or sets the value.
16+
public var value: String?
17+
18+
public init(key: String? = nil, value: String? = nil) {
19+
self.key = key
20+
self.value = value
21+
}
22+
23+
public init(from decoder: Decoder) throws {
24+
let values = try decoder.container(keyedBy: StringCodingKey.self)
25+
self.key = try values.decodeIfPresent(String.self, forKey: "Key")
26+
self.value = try values.decodeIfPresent(String.self, forKey: "Value")
27+
}
28+
29+
public func encode(to encoder: Encoder) throws {
30+
var values = encoder.container(keyedBy: StringCodingKey.self)
31+
try values.encodeIfPresent(key, forKey: "Key")
32+
try values.encodeIfPresent(value, forKey: "Value")
33+
}
34+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//
2+
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
3+
// License, v2.0. If a copy of the MPL was not distributed with this
4+
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
5+
//
6+
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors
7+
//
8+
9+
import Foundation
10+
11+
/// Defines the options for a custom database connector.
12+
public struct CustomDatabaseOptions: Codable, Hashable {
13+
/// Gets or sets the connection string for the custom database provider.
14+
public var connectionString: String?
15+
/// Gets or sets the list of extra options for the custom provider.
16+
public var options: [CustomDatabaseOption]?
17+
/// Gets or sets the plugin assembly to search for providers.
18+
public var pluginAssembly: String?
19+
/// Gets or sets the Plugin name to search for database providers.
20+
public var pluginName: String?
21+
22+
public init(
23+
connectionString: String? = nil,
24+
options: [CustomDatabaseOption]? = nil,
25+
pluginAssembly: String? = nil,
26+
pluginName: String? = nil
27+
) {
28+
self.connectionString = connectionString
29+
self.options = options
30+
self.pluginAssembly = pluginAssembly
31+
self.pluginName = pluginName
32+
}
33+
34+
public init(from decoder: Decoder) throws {
35+
let values = try decoder.container(keyedBy: StringCodingKey.self)
36+
self.connectionString = try values.decodeIfPresent(String.self, forKey: "ConnectionString")
37+
self.options = try values.decodeIfPresent([CustomDatabaseOption].self, forKey: "Options")
38+
self.pluginAssembly = try values.decodeIfPresent(String.self, forKey: "PluginAssembly")
39+
self.pluginName = try values.decodeIfPresent(String.self, forKey: "PluginName")
40+
}
41+
42+
public func encode(to encoder: Encoder) throws {
43+
var values = encoder.container(keyedBy: StringCodingKey.self)
44+
try values.encodeIfPresent(connectionString, forKey: "ConnectionString")
45+
try values.encodeIfPresent(options, forKey: "Options")
46+
try values.encodeIfPresent(pluginAssembly, forKey: "PluginAssembly")
47+
try values.encodeIfPresent(pluginName, forKey: "PluginName")
48+
}
49+
}

0 commit comments

Comments
 (0)