This commit is contained in:
Ethan Pippin 2022-08-15 20:37:47 -06:00
parent 60bbdb9fa0
commit 682fbdbf38
698 changed files with 1282 additions and 6247 deletions

View File

@ -1,6 +1,6 @@
# version: 0.49.11
--swiftversion 5.5
--swiftversion 5.6
--tabwidth 4
--xcodeindentation enabled
@ -43,4 +43,4 @@
redundantClosure, \
redundantType
--header "\nSwiftfin is subject to the terms of the Mozilla Public\nLicense, v2.0. If a copy of the MPL was not distributed with this\nfile, you can obtain one at https://mozilla.org/MPL/2.0/.\n\nCopyright (c) {year} Jellyfin & Jellyfin Contributors\n"
--header "\njellyfin-sdk-swift is subject to the terms of the Mozilla Public\nLicense, v2.0. If a copy of the MPL was not distributed with this\nfile, you can obtain one at https://mozilla.org/MPL/2.0/.\n\nCopyright (c) {year} Jellyfin & Jellyfin Contributors\n"

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -28,22 +28,4 @@ public struct AccessSchedule: Codable, Identifiable {
self.startHour = startHour
self.userID = userID
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.dayOfWeek = try values.decodeIfPresent(DynamicDayOfWeek.self, forKey: "DayOfWeek")
self.endHour = try values.decodeIfPresent(Double.self, forKey: "EndHour")
self.id = try values.decodeIfPresent(Int.self, forKey: "Id")
self.startHour = try values.decodeIfPresent(Double.self, forKey: "StartHour")
self.userID = try values.decodeIfPresent(UUID.self, forKey: "UserId")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(dayOfWeek, forKey: "DayOfWeek")
try values.encodeIfPresent(endHour, forKey: "EndHour")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(startHour, forKey: "StartHour")
try values.encodeIfPresent(userID, forKey: "UserId")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -56,32 +56,4 @@ public struct ActivityLogEntry: Codable, Identifiable {
self.userID = userID
self.userPrimaryImageTag = userPrimaryImageTag
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.date = try values.decodeIfPresent(Date.self, forKey: "Date")
self.id = try values.decodeIfPresent(Int.self, forKey: "Id")
self.itemID = try values.decodeIfPresent(String.self, forKey: "ItemId")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.overview = try values.decodeIfPresent(String.self, forKey: "Overview")
self.severity = try values.decodeIfPresent(LogLevel.self, forKey: "Severity")
self.shortOverview = try values.decodeIfPresent(String.self, forKey: "ShortOverview")
self.type = try values.decodeIfPresent(String.self, forKey: "Type")
self.userID = try values.decodeIfPresent(UUID.self, forKey: "UserId")
self.userPrimaryImageTag = try values.decodeIfPresent(String.self, forKey: "UserPrimaryImageTag")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(date, forKey: "Date")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(itemID, forKey: "ItemId")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(overview, forKey: "Overview")
try values.encodeIfPresent(severity, forKey: "Severity")
try values.encodeIfPresent(shortOverview, forKey: "ShortOverview")
try values.encodeIfPresent(type, forKey: "Type")
try values.encodeIfPresent(userID, forKey: "UserId")
try values.encodeIfPresent(userPrimaryImageTag, forKey: "UserPrimaryImageTag")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -21,18 +21,4 @@ public struct ActivityLogEntryQueryResult: Codable {
self.startIndex = startIndex
self.totalRecordCount = totalRecordCount
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.items = try values.decodeIfPresent([ActivityLogEntry].self, forKey: "Items")
self.startIndex = try values.decodeIfPresent(Int.self, forKey: "StartIndex")
self.totalRecordCount = try values.decodeIfPresent(Int.self, forKey: "TotalRecordCount")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(items, forKey: "Items")
try values.encodeIfPresent(startIndex, forKey: "StartIndex")
try values.encodeIfPresent(totalRecordCount, forKey: "TotalRecordCount")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -16,14 +16,4 @@ public struct AddVirtualFolderDto: Codable {
public init(libraryOptions: LibraryOptions? = nil) {
self.libraryOptions = libraryOptions
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.libraryOptions = try values.decodeIfPresent(LibraryOptions.self, forKey: "LibraryOptions")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(libraryOptions, forKey: "LibraryOptions")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -25,20 +25,4 @@ public struct AdminNotificationDto: Codable {
self.notificationLevel = notificationLevel
self.url = url
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.description = try values.decodeIfPresent(String.self, forKey: "Description")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.notificationLevel = try values.decodeIfPresent(NotificationLevel.self, forKey: "NotificationLevel")
self.url = try values.decodeIfPresent(String.self, forKey: "Url")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(description, forKey: "Description")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(notificationLevel, forKey: "NotificationLevel")
try values.encodeIfPresent(url, forKey: "Url")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -64,40 +64,4 @@ public struct AlbumInfo: Codable {
self.songInfos = songInfos
self.year = year
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.albumArtists = try values.decodeIfPresent([String].self, forKey: "AlbumArtists")
self.artistProviderIDs = try values.decodeIfPresent([String: String].self, forKey: "ArtistProviderIds")
self.indexNumber = try values.decodeIfPresent(Int.self, forKey: "IndexNumber")
self.isAutomated = try values.decodeIfPresent(Bool.self, forKey: "IsAutomated")
self.metadataCountryCode = try values.decodeIfPresent(String.self, forKey: "MetadataCountryCode")
self.metadataLanguage = try values.decodeIfPresent(String.self, forKey: "MetadataLanguage")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.originalTitle = try values.decodeIfPresent(String.self, forKey: "OriginalTitle")
self.parentIndexNumber = try values.decodeIfPresent(Int.self, forKey: "ParentIndexNumber")
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
self.premiereDate = try values.decodeIfPresent(Date.self, forKey: "PremiereDate")
self.providerIDs = try values.decodeIfPresent([String: String].self, forKey: "ProviderIds")
self.songInfos = try values.decodeIfPresent([SongInfo].self, forKey: "SongInfos")
self.year = try values.decodeIfPresent(Int.self, forKey: "Year")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(albumArtists, forKey: "AlbumArtists")
try values.encodeIfPresent(artistProviderIDs, forKey: "ArtistProviderIds")
try values.encodeIfPresent(indexNumber, forKey: "IndexNumber")
try values.encodeIfPresent(isAutomated, forKey: "IsAutomated")
try values.encodeIfPresent(metadataCountryCode, forKey: "MetadataCountryCode")
try values.encodeIfPresent(metadataLanguage, forKey: "MetadataLanguage")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(originalTitle, forKey: "OriginalTitle")
try values.encodeIfPresent(parentIndexNumber, forKey: "ParentIndexNumber")
try values.encodeIfPresent(path, forKey: "Path")
try values.encodeIfPresent(premiereDate, forKey: "PremiereDate")
try values.encodeIfPresent(providerIDs, forKey: "ProviderIds")
try values.encodeIfPresent(songInfos, forKey: "SongInfos")
try values.encodeIfPresent(year, forKey: "Year")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -27,20 +27,4 @@ public struct AlbumInfoRemoteSearchQuery: Codable {
self.searchInfo = searchInfo
self.searchProviderName = searchProviderName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.isIncludeDisabledProviders = try values.decodeIfPresent(Bool.self, forKey: "IncludeDisabledProviders")
self.itemID = try values.decodeIfPresent(UUID.self, forKey: "ItemId")
self.searchInfo = try values.decodeIfPresent(AlbumInfo.self, forKey: "SearchInfo")
self.searchProviderName = try values.decodeIfPresent(String.self, forKey: "SearchProviderName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(isIncludeDisabledProviders, forKey: "IncludeDisabledProviders")
try values.encodeIfPresent(itemID, forKey: "ItemId")
try values.encodeIfPresent(searchInfo, forKey: "SearchInfo")
try values.encodeIfPresent(searchProviderName, forKey: "SearchProviderName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -25,18 +25,4 @@ public struct AllThemeMediaResult: Codable {
self.themeSongsResult = themeSongsResult
self.themeVideosResult = themeVideosResult
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.soundtrackSongsResult = try values.decodeIfPresent(ThemeMediaResult.self, forKey: "SoundtrackSongsResult")
self.themeSongsResult = try values.decodeIfPresent(ThemeMediaResult.self, forKey: "ThemeSongsResult")
self.themeVideosResult = try values.decodeIfPresent(ThemeMediaResult.self, forKey: "ThemeVideosResult")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(soundtrackSongsResult, forKey: "SoundtrackSongsResult")
try values.encodeIfPresent(themeSongsResult, forKey: "ThemeSongsResult")
try values.encodeIfPresent(themeVideosResult, forKey: "ThemeVideosResult")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -56,36 +56,4 @@ public struct ArtistInfo: Codable {
self.songInfos = songInfos
self.year = year
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.indexNumber = try values.decodeIfPresent(Int.self, forKey: "IndexNumber")
self.isAutomated = try values.decodeIfPresent(Bool.self, forKey: "IsAutomated")
self.metadataCountryCode = try values.decodeIfPresent(String.self, forKey: "MetadataCountryCode")
self.metadataLanguage = try values.decodeIfPresent(String.self, forKey: "MetadataLanguage")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.originalTitle = try values.decodeIfPresent(String.self, forKey: "OriginalTitle")
self.parentIndexNumber = try values.decodeIfPresent(Int.self, forKey: "ParentIndexNumber")
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
self.premiereDate = try values.decodeIfPresent(Date.self, forKey: "PremiereDate")
self.providerIDs = try values.decodeIfPresent([String: String].self, forKey: "ProviderIds")
self.songInfos = try values.decodeIfPresent([SongInfo].self, forKey: "SongInfos")
self.year = try values.decodeIfPresent(Int.self, forKey: "Year")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(indexNumber, forKey: "IndexNumber")
try values.encodeIfPresent(isAutomated, forKey: "IsAutomated")
try values.encodeIfPresent(metadataCountryCode, forKey: "MetadataCountryCode")
try values.encodeIfPresent(metadataLanguage, forKey: "MetadataLanguage")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(originalTitle, forKey: "OriginalTitle")
try values.encodeIfPresent(parentIndexNumber, forKey: "ParentIndexNumber")
try values.encodeIfPresent(path, forKey: "Path")
try values.encodeIfPresent(premiereDate, forKey: "PremiereDate")
try values.encodeIfPresent(providerIDs, forKey: "ProviderIds")
try values.encodeIfPresent(songInfos, forKey: "SongInfos")
try values.encodeIfPresent(year, forKey: "Year")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -27,20 +27,4 @@ public struct ArtistInfoRemoteSearchQuery: Codable {
self.searchInfo = searchInfo
self.searchProviderName = searchProviderName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.isIncludeDisabledProviders = try values.decodeIfPresent(Bool.self, forKey: "IncludeDisabledProviders")
self.itemID = try values.decodeIfPresent(UUID.self, forKey: "ItemId")
self.searchInfo = try values.decodeIfPresent(ArtistInfo.self, forKey: "SearchInfo")
self.searchProviderName = try values.decodeIfPresent(String.self, forKey: "SearchProviderName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(isIncludeDisabledProviders, forKey: "IncludeDisabledProviders")
try values.encodeIfPresent(itemID, forKey: "ItemId")
try values.encodeIfPresent(searchInfo, forKey: "SearchInfo")
try values.encodeIfPresent(searchProviderName, forKey: "SearchProviderName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -24,18 +24,4 @@ public struct AuthenticateUserByName: Codable {
self.pw = pw
self.username = username
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.password = try values.decodeIfPresent(String.self, forKey: "Password")
self.pw = try values.decodeIfPresent(String.self, forKey: "Pw")
self.username = try values.decodeIfPresent(String.self, forKey: "Username")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(password, forKey: "Password")
try values.encodeIfPresent(pw, forKey: "Pw")
try values.encodeIfPresent(username, forKey: "Username")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -59,36 +59,4 @@ public struct AuthenticationInfo: Codable, Identifiable {
self.userID = userID
self.userName = userName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.accessToken = try values.decodeIfPresent(String.self, forKey: "AccessToken")
self.appName = try values.decodeIfPresent(String.self, forKey: "AppName")
self.appVersion = try values.decodeIfPresent(String.self, forKey: "AppVersion")
self.dateCreated = try values.decodeIfPresent(Date.self, forKey: "DateCreated")
self.dateLastActivity = try values.decodeIfPresent(Date.self, forKey: "DateLastActivity")
self.dateRevoked = try values.decodeIfPresent(Date.self, forKey: "DateRevoked")
self.deviceID = try values.decodeIfPresent(String.self, forKey: "DeviceId")
self.deviceName = try values.decodeIfPresent(String.self, forKey: "DeviceName")
self.id = try values.decodeIfPresent(Int.self, forKey: "Id")
self.isActive = try values.decodeIfPresent(Bool.self, forKey: "IsActive")
self.userID = try values.decodeIfPresent(UUID.self, forKey: "UserId")
self.userName = try values.decodeIfPresent(String.self, forKey: "UserName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(accessToken, forKey: "AccessToken")
try values.encodeIfPresent(appName, forKey: "AppName")
try values.encodeIfPresent(appVersion, forKey: "AppVersion")
try values.encodeIfPresent(dateCreated, forKey: "DateCreated")
try values.encodeIfPresent(dateLastActivity, forKey: "DateLastActivity")
try values.encodeIfPresent(dateRevoked, forKey: "DateRevoked")
try values.encodeIfPresent(deviceID, forKey: "DeviceId")
try values.encodeIfPresent(deviceName, forKey: "DeviceName")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(isActive, forKey: "IsActive")
try values.encodeIfPresent(userID, forKey: "UserId")
try values.encodeIfPresent(userName, forKey: "UserName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -21,18 +21,4 @@ public struct AuthenticationInfoQueryResult: Codable {
self.startIndex = startIndex
self.totalRecordCount = totalRecordCount
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.items = try values.decodeIfPresent([AuthenticationInfo].self, forKey: "Items")
self.startIndex = try values.decodeIfPresent(Int.self, forKey: "StartIndex")
self.totalRecordCount = try values.decodeIfPresent(Int.self, forKey: "TotalRecordCount")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(items, forKey: "Items")
try values.encodeIfPresent(startIndex, forKey: "StartIndex")
try values.encodeIfPresent(totalRecordCount, forKey: "TotalRecordCount")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -22,20 +22,4 @@ public struct AuthenticationResult: Codable {
self.sessionInfo = sessionInfo
self.user = user
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.accessToken = try values.decodeIfPresent(String.self, forKey: "AccessToken")
self.serverID = try values.decodeIfPresent(String.self, forKey: "ServerId")
self.sessionInfo = try values.decodeIfPresent(SessionInfo.self, forKey: "SessionInfo")
self.user = try values.decodeIfPresent(UserDto.self, forKey: "User")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(accessToken, forKey: "AccessToken")
try values.encodeIfPresent(serverID, forKey: "ServerId")
try values.encodeIfPresent(sessionInfo, forKey: "SessionInfo")
try values.encodeIfPresent(user, forKey: "User")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -48,34 +48,4 @@ public struct BaseItem: Codable {
self.isSupportsExternalTransfer = isSupportsExternalTransfer
self.width = width
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.container = try values.decodeIfPresent(String.self, forKey: "Container")
self.dateLastSaved = try values.decodeIfPresent(Date.self, forKey: "DateLastSaved")
self.extraIDs = try values.decodeIfPresent([UUID].self, forKey: "ExtraIds")
self.height = try values.decodeIfPresent(Int.self, forKey: "Height")
self.isHD = try values.decodeIfPresent(Bool.self, forKey: "IsHD")
self.isShortcut = try values.decodeIfPresent(Bool.self, forKey: "IsShortcut")
self.remoteTrailers = try values.decodeIfPresent([MediaURL].self, forKey: "RemoteTrailers")
self.shortcutPath = try values.decodeIfPresent(String.self, forKey: "ShortcutPath")
self.size = try values.decodeIfPresent(Int.self, forKey: "Size")
self.isSupportsExternalTransfer = try values.decodeIfPresent(Bool.self, forKey: "SupportsExternalTransfer")
self.width = try values.decodeIfPresent(Int.self, forKey: "Width")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(container, forKey: "Container")
try values.encodeIfPresent(dateLastSaved, forKey: "DateLastSaved")
try values.encodeIfPresent(extraIDs, forKey: "ExtraIds")
try values.encodeIfPresent(height, forKey: "Height")
try values.encodeIfPresent(isHD, forKey: "IsHD")
try values.encodeIfPresent(isShortcut, forKey: "IsShortcut")
try values.encodeIfPresent(remoteTrailers, forKey: "RemoteTrailers")
try values.encodeIfPresent(shortcutPath, forKey: "ShortcutPath")
try values.encodeIfPresent(size, forKey: "Size")
try values.encodeIfPresent(isSupportsExternalTransfer, forKey: "SupportsExternalTransfer")
try values.encodeIfPresent(width, forKey: "Width")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -11,276 +11,274 @@ import Foundation
/// 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.
public final class BaseItemDto: Codable, Identifiable {
public struct BaseItemDto: Codable, Identifiable {
/// Gets or sets the air days.
public let airDays: [DayOfWeek]?
public var airDays: [DayOfWeek]?
/// Gets or sets the air time.
public let airTime: String?
public let airsAfterSeasonNumber: Int?
public let airsBeforeEpisodeNumber: Int?
public let airsBeforeSeasonNumber: Int?
public var airTime: String?
public var airsAfterSeasonNumber: Int?
public var airsBeforeEpisodeNumber: Int?
public var airsBeforeSeasonNumber: Int?
/// Gets or sets the album.
public let album: String?
public var album: String?
/// Gets or sets the album artist.
public let albumArtist: String?
public var albumArtist: String?
/// Gets or sets the album artists.
public let albumArtists: [NameGuidPair]?
public var albumArtists: [NameGuidPair]?
/// Gets or sets the album count.
public let albumCount: Int?
public var albumCount: Int?
/// Gets or sets the album id.
public let albumID: UUID?
public var albumID: UUID?
/// Gets or sets the album image tag.
public let albumPrimaryImageTag: String?
public let altitude: Double?
public let aperture: Double?
public let artistCount: Int?
public var albumPrimaryImageTag: String?
public var altitude: Double?
public var aperture: Double?
public var artistCount: Int?
/// Gets or sets the artist items.
public let artistItems: [NameGuidPair]?
public var artistItems: [NameGuidPair]?
/// Gets or sets the artists.
public let artists: [String]?
public var artists: [String]?
/// Gets or sets the aspect ratio.
public let aspectRatio: String?
public var aspectRatio: String?
/// Gets or sets the audio.
public let audio: ProgramAudio?
public var audio: ProgramAudio?
/// Gets or sets the backdrop image tags.
public let backdropImageTags: [String]?
public let cameraMake: String?
public let cameraModel: String?
public let canDelete: Bool?
public let canDownload: Bool?
public var backdropImageTags: [String]?
public var cameraMake: String?
public var cameraModel: String?
public var canDelete: Bool?
public var canDownload: Bool?
/// Gets or sets the channel identifier.
public let channelID: UUID?
public let channelName: String?
public let channelNumber: String?
public var channelID: UUID?
public var channelName: String?
public var channelNumber: String?
/// Gets or sets the channel primary image tag.
public let channelPrimaryImageTag: String?
public var channelPrimaryImageTag: String?
/// Gets or sets the type of the channel.
public let channelType: ChannelType?
public var channelType: ChannelType?
/// Gets or sets the chapters.
public let chapters: [ChapterInfo]?
public var chapters: [ChapterInfo]?
/// Gets or sets the child count.
public let childCount: Int?
public var childCount: Int?
/// Gets or sets the type of the collection.
public let collectionType: String?
public var collectionType: String?
/// Gets or sets the community rating.
public let communityRating: Double?
public var communityRating: Double?
/// Gets or sets the completion percentage.
public let completionPercentage: Double?
public let container: String?
public var completionPercentage: Double?
public var container: String?
/// Gets or sets the critic rating.
public let criticRating: Double?
public var criticRating: Double?
/// Gets or sets the cumulative run time ticks.
public let cumulativeRunTimeTicks: Int?
/// Gets or sets the current program.
public let currentProgram: BaseItemDto?
public var cumulativeRunTimeTicks: Int?
/// Gets or sets the custom rating.
public let customRating: String?
public var customRating: String?
/// Gets or sets the date created.
public let dateCreated: Date?
public let dateLastMediaAdded: Date?
public var dateCreated: Date?
public var dateLastMediaAdded: Date?
/// Gets or sets the display order.
public let displayOrder: String?
public var displayOrder: String?
/// Gets or sets the display preferences id.
public let displayPreferencesID: String?
public let enableMediaSourceDisplay: Bool?
public var displayPreferencesID: String?
public var enableMediaSourceDisplay: Bool?
/// Gets or sets the end date.
public let endDate: Date?
public var endDate: Date?
/// Gets or sets the episode count.
public let episodeCount: Int?
public var episodeCount: Int?
/// Gets or sets the episode title.
public let episodeTitle: String?
public var episodeTitle: String?
/// Gets or sets the etag.
public let etag: String?
public let exposureTime: Double?
public var etag: String?
public var exposureTime: Double?
/// Gets or sets the external urls.
public let externalURLs: [ExternalURL]?
public let extraType: String?
public let focalLength: Double?
public let forcedSortName: String?
public let genreItems: [NameGuidPair]?
public var externalURLs: [ExternalURL]?
public var extraType: String?
public var focalLength: Double?
public var forcedSortName: String?
public var genreItems: [NameGuidPair]?
/// Gets or sets the genres.
public let genres: [String]?
public let hasSubtitles: Bool?
public let height: Int?
public var genres: [String]?
public var hasSubtitles: Bool?
public var height: Int?
/// Gets or sets the id.
public let id: UUID?
public var id: UUID?
/// Gets or sets the blurhashes for the image tags.
///
/// Maps image type to dictionary mapping image tag to blurhash value.
public let imageBlurHashes: ImageBlurHashes?
public let imageOrientation: ImageOrientation?
public var imageBlurHashes: ImageBlurHashes?
public var imageOrientation: ImageOrientation?
/// Gets or sets the image tags.
public let imageTags: [String: String]?
public var imageTags: [String: String]?
/// Gets or sets the index number.
public let indexNumber: Int?
public var indexNumber: Int?
/// Gets or sets the index number end.
public let indexNumberEnd: Int?
public var indexNumberEnd: Int?
/// Gets or sets a value indicating whether this instance is folder.
public let isFolder: Bool?
public var isFolder: Bool?
/// Gets or sets a value indicating whether this instance is HD.
public let isHD: Bool?
public var isHD: Bool?
/// Gets or sets a value indicating whether this instance is kids.
public let isKids: Bool?
public var isKids: Bool?
/// Gets or sets a value indicating whether this instance is live.
public let isLive: Bool?
public var isLive: Bool?
/// Gets or sets a value indicating whether this instance is movie.
public let isMovie: Bool?
public var isMovie: Bool?
/// Gets or sets a value indicating whether this instance is news.
public let isNews: Bool?
public var isNews: Bool?
/// Gets or sets a value indicating whether this instance is place holder.
public let isPlaceHolder: Bool?
public var isPlaceHolder: Bool?
/// Gets or sets a value indicating whether this instance is premiere.
public let isPremiere: Bool?
public var isPremiere: Bool?
/// Gets or sets a value indicating whether this instance is repeat.
public let isRepeat: Bool?
public var isRepeat: Bool?
/// Gets or sets a value indicating whether this instance is series.
public let isSeries: Bool?
public var isSeries: Bool?
/// Gets or sets a value indicating whether this instance is sports.
public let isSports: Bool?
public let isoSpeedRating: Int?
public var isSports: Bool?
public var isoSpeedRating: Int?
/// Gets or sets the type of the iso.
public let isoType: IsoType?
public let latitude: Double?
public var isoType: IsoType?
public var latitude: Double?
/// Gets or sets the local trailer count.
public let localTrailerCount: Int?
public var localTrailerCount: Int?
/// Gets or sets the type of the location.
public let locationType: LocationType?
public var locationType: LocationType?
/// Gets or sets a value indicating whether [enable internet providers].
public let lockData: Bool?
public var lockData: Bool?
/// Gets or sets the locked fields.
public let lockedFields: [MetadataField]?
public let longitude: Double?
public let mediaSourceCount: Int?
public var lockedFields: [MetadataField]?
public var longitude: Double?
public var mediaSourceCount: Int?
/// Gets or sets the media versions.
public let mediaSources: [MediaSourceInfo]?
public var mediaSources: [MediaSourceInfo]?
/// Gets or sets the media streams.
public let mediaStreams: [MediaStream]?
public var mediaStreams: [MediaStream]?
/// Gets or sets the type of the media.
public let mediaType: String?
public var mediaType: String?
/// Gets or sets the movie count.
public let movieCount: Int?
public var movieCount: Int?
/// Gets or sets the music video count.
public let musicVideoCount: Int?
public var musicVideoCount: Int?
/// Gets or sets the name.
public let name: String?
public var name: String?
/// Gets or sets the number.
public let number: String?
public var number: String?
/// Gets or sets the official rating.
public let officialRating: String?
public let originalTitle: String?
public var officialRating: String?
public var originalTitle: String?
/// Gets or sets the overview.
public let overview: String?
public var overview: String?
/// Gets or sets the parent art image tag.
public let parentArtImageTag: String?
public var parentArtImageTag: String?
/// Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one.
public let parentArtItemID: UUID?
public var parentArtItemID: UUID?
/// Gets or sets the parent backdrop image tags.
public let parentBackdropImageTags: [String]?
public var parentBackdropImageTags: [String]?
/// Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one.
public let parentBackdropItemID: UUID?
public var parentBackdropItemID: UUID?
/// Gets or sets the parent id.
public let parentID: UUID?
public var parentID: UUID?
/// Gets or sets the parent index number.
public let parentIndexNumber: Int?
public var parentIndexNumber: Int?
/// Gets or sets the parent logo image tag.
public let parentLogoImageTag: String?
public var parentLogoImageTag: String?
/// Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one.
public let parentLogoItemID: UUID?
public var parentLogoItemID: UUID?
/// Gets or sets the parent primary image item identifier.
public let parentPrimaryImageItemID: String?
public var parentPrimaryImageItemID: String?
/// Gets or sets the parent primary image tag.
public let parentPrimaryImageTag: String?
public var parentPrimaryImageTag: String?
/// Gets or sets the parent thumb image tag.
public let parentThumbImageTag: String?
public var parentThumbImageTag: String?
/// Gets or sets the parent thumb item id.
public let parentThumbItemID: UUID?
public var parentThumbItemID: UUID?
/// Gets or sets the part count.
public let partCount: Int?
public var partCount: Int?
/// Gets or sets the path.
public let path: String?
public var path: String?
/// Gets or sets the people.
public let people: [BaseItemPerson]?
public var people: [BaseItemPerson]?
/// Gets or sets the play access.
public let playAccess: PlayAccess?
public var playAccess: PlayAccess?
/// Gets or sets the playlist item identifier.
public let playlistItemID: String?
public let preferredMetadataCountryCode: String?
public let preferredMetadataLanguage: String?
public var playlistItemID: String?
public var preferredMetadataCountryCode: String?
public var preferredMetadataLanguage: String?
/// Gets or sets the premiere date.
public let premiereDate: Date?
public var premiereDate: Date?
/// Gets or sets the primary image aspect ratio, after image enhancements.
public let primaryImageAspectRatio: Double?
public let productionLocations: [String]?
public var primaryImageAspectRatio: Double?
public var productionLocations: [String]?
/// Gets or sets the production year.
public let productionYear: Int?
public let programCount: Int?
public var productionYear: Int?
public var programCount: Int?
/// Gets or sets the program identifier.
public let programID: String?
public var programID: String?
/// Gets or sets the provider ids.
public let providerIDs: [String: String]?
public var providerIDs: [String: String]?
/// Gets or sets the recursive item count.
public let recursiveItemCount: Int?
public var recursiveItemCount: Int?
/// Gets or sets the trailer urls.
public let remoteTrailers: [MediaURL]?
public var remoteTrailers: [MediaURL]?
/// Gets or sets the run time ticks.
public let runTimeTicks: Int?
public var runTimeTicks: Int?
/// Gets or sets the screenshot image tags.
public let screenshotImageTags: [String]?
public var screenshotImageTags: [String]?
/// Gets or sets the season identifier.
public let seasonID: UUID?
public var seasonID: UUID?
/// Gets or sets the name of the season.
public let seasonName: String?
public var seasonName: String?
/// Gets or sets the series count.
public let seriesCount: Int?
public var seriesCount: Int?
/// Gets or sets the series id.
public let seriesID: UUID?
public var seriesID: UUID?
/// Gets or sets the name of the series.
public let seriesName: String?
public var seriesName: String?
/// Gets or sets the series primary image tag.
public let seriesPrimaryImageTag: String?
public var seriesPrimaryImageTag: String?
/// Gets or sets the series studio.
public let seriesStudio: String?
public var seriesStudio: String?
/// Gets or sets the series thumb image tag.
public let seriesThumbImageTag: String?
public var seriesThumbImageTag: String?
/// Gets or sets the series timer identifier.
public let seriesTimerID: String?
public var seriesTimerID: String?
/// Gets or sets the server identifier.
public let serverID: String?
public let shutterSpeed: Double?
public let software: String?
public var serverID: String?
public var shutterSpeed: Double?
public var software: String?
/// Gets or sets the song count.
public let songCount: Int?
public var songCount: Int?
/// Gets or sets the name of the sort.
public let sortName: String?
public var sortName: String?
/// Gets or sets the type of the source.
public let sourceType: String?
public var sourceType: String?
/// Gets or sets the special feature count.
public let specialFeatureCount: Int?
public var specialFeatureCount: Int?
/// Gets or sets the start date of the recording, in UTC.
public let startDate: Date?
public var startDate: Date?
/// Gets or sets the status.
public let status: String?
public var status: String?
/// Gets or sets the studios.
public let studios: [NameGuidPair]?
public var studios: [NameGuidPair]?
/// Gets or sets a value indicating whether [supports synchronize].
public let isSupportsSync: Bool?
public var isSupportsSync: Bool?
/// Gets or sets the taglines.
public let taglines: [String]?
public var taglines: [String]?
/// Gets or sets the tags.
public let tags: [String]?
public var tags: [String]?
/// Gets or sets the timer identifier.
public let timerID: String?
public var timerID: String?
/// Gets or sets the trailer count.
public let trailerCount: Int?
public var trailerCount: Int?
/// Gets or sets the type.
public let type: BaseItemKind?
public var type: BaseItemKind?
/// Gets or sets the user data for this item based on the user it's being requested for.
public let userData: UserItemDataDto?
public var userData: UserItemDataDto?
/// Gets or sets the video3 D format.
public let video3DFormat: Video3DFormat?
public var video3DFormat: Video3DFormat?
/// Gets or sets the type of the video.
public let videoType: VideoType?
public let width: Int?
public var videoType: VideoType?
public var width: Int?
/// Gets or sets the blurhashes for the image tags.
///
@ -329,40 +327,6 @@ public final class BaseItemDto: Codable, Identifiable {
self.screenshot = screenshot
self.thumb = thumb
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.art = try values.decodeIfPresent([String: String].self, forKey: "Art")
self.backdrop = try values.decodeIfPresent([String: String].self, forKey: "Backdrop")
self.banner = try values.decodeIfPresent([String: String].self, forKey: "Banner")
self.box = try values.decodeIfPresent([String: String].self, forKey: "Box")
self.boxRear = try values.decodeIfPresent([String: String].self, forKey: "BoxRear")
self.chapter = try values.decodeIfPresent([String: String].self, forKey: "Chapter")
self.disc = try values.decodeIfPresent([String: String].self, forKey: "Disc")
self.logo = try values.decodeIfPresent([String: String].self, forKey: "Logo")
self.menu = try values.decodeIfPresent([String: String].self, forKey: "Menu")
self.primary = try values.decodeIfPresent([String: String].self, forKey: "Primary")
self.profile = try values.decodeIfPresent([String: String].self, forKey: "Profile")
self.screenshot = try values.decodeIfPresent([String: String].self, forKey: "Screenshot")
self.thumb = try values.decodeIfPresent([String: String].self, forKey: "Thumb")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(art, forKey: "Art")
try values.encodeIfPresent(backdrop, forKey: "Backdrop")
try values.encodeIfPresent(banner, forKey: "Banner")
try values.encodeIfPresent(box, forKey: "Box")
try values.encodeIfPresent(boxRear, forKey: "BoxRear")
try values.encodeIfPresent(chapter, forKey: "Chapter")
try values.encodeIfPresent(disc, forKey: "Disc")
try values.encodeIfPresent(logo, forKey: "Logo")
try values.encodeIfPresent(menu, forKey: "Menu")
try values.encodeIfPresent(primary, forKey: "Primary")
try values.encodeIfPresent(profile, forKey: "Profile")
try values.encodeIfPresent(screenshot, forKey: "Screenshot")
try values.encodeIfPresent(thumb, forKey: "Thumb")
}
}
public init(
@ -402,7 +366,6 @@ public final class BaseItemDto: Codable, Identifiable {
container: String? = nil,
criticRating: Double? = nil,
cumulativeRunTimeTicks: Int? = nil,
currentProgram: BaseItemDto? = nil,
customRating: String? = nil,
dateCreated: Date? = nil,
dateLastMediaAdded: Date? = nil,
@ -554,7 +517,6 @@ public final class BaseItemDto: Codable, Identifiable {
self.container = container
self.criticRating = criticRating
self.cumulativeRunTimeTicks = cumulativeRunTimeTicks
self.currentProgram = currentProgram
self.customRating = customRating
self.dateCreated = dateCreated
self.dateLastMediaAdded = dateLastMediaAdded
@ -670,314 +632,4 @@ public final class BaseItemDto: Codable, Identifiable {
self.videoType = videoType
self.width = width
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.airDays = try values.decodeIfPresent([DayOfWeek].self, forKey: "AirDays")
self.airTime = try values.decodeIfPresent(String.self, forKey: "AirTime")
self.airsAfterSeasonNumber = try values.decodeIfPresent(Int.self, forKey: "AirsAfterSeasonNumber")
self.airsBeforeEpisodeNumber = try values.decodeIfPresent(Int.self, forKey: "AirsBeforeEpisodeNumber")
self.airsBeforeSeasonNumber = try values.decodeIfPresent(Int.self, forKey: "AirsBeforeSeasonNumber")
self.album = try values.decodeIfPresent(String.self, forKey: "Album")
self.albumArtist = try values.decodeIfPresent(String.self, forKey: "AlbumArtist")
self.albumArtists = try values.decodeIfPresent([NameGuidPair].self, forKey: "AlbumArtists")
self.albumCount = try values.decodeIfPresent(Int.self, forKey: "AlbumCount")
self.albumID = try values.decodeIfPresent(UUID.self, forKey: "AlbumId")
self.albumPrimaryImageTag = try values.decodeIfPresent(String.self, forKey: "AlbumPrimaryImageTag")
self.altitude = try values.decodeIfPresent(Double.self, forKey: "Altitude")
self.aperture = try values.decodeIfPresent(Double.self, forKey: "Aperture")
self.artistCount = try values.decodeIfPresent(Int.self, forKey: "ArtistCount")
self.artistItems = try values.decodeIfPresent([NameGuidPair].self, forKey: "ArtistItems")
self.artists = try values.decodeIfPresent([String].self, forKey: "Artists")
self.aspectRatio = try values.decodeIfPresent(String.self, forKey: "AspectRatio")
self.audio = try values.decodeIfPresent(ProgramAudio.self, forKey: "Audio")
self.backdropImageTags = try values.decodeIfPresent([String].self, forKey: "BackdropImageTags")
self.cameraMake = try values.decodeIfPresent(String.self, forKey: "CameraMake")
self.cameraModel = try values.decodeIfPresent(String.self, forKey: "CameraModel")
self.canDelete = try values.decodeIfPresent(Bool.self, forKey: "CanDelete")
self.canDownload = try values.decodeIfPresent(Bool.self, forKey: "CanDownload")
self.channelID = try values.decodeIfPresent(UUID.self, forKey: "ChannelId")
self.channelName = try values.decodeIfPresent(String.self, forKey: "ChannelName")
self.channelNumber = try values.decodeIfPresent(String.self, forKey: "ChannelNumber")
self.channelPrimaryImageTag = try values.decodeIfPresent(String.self, forKey: "ChannelPrimaryImageTag")
self.channelType = try values.decodeIfPresent(ChannelType.self, forKey: "ChannelType")
self.chapters = try values.decodeIfPresent([ChapterInfo].self, forKey: "Chapters")
self.childCount = try values.decodeIfPresent(Int.self, forKey: "ChildCount")
self.collectionType = try values.decodeIfPresent(String.self, forKey: "CollectionType")
self.communityRating = try values.decodeIfPresent(Double.self, forKey: "CommunityRating")
self.completionPercentage = try values.decodeIfPresent(Double.self, forKey: "CompletionPercentage")
self.container = try values.decodeIfPresent(String.self, forKey: "Container")
self.criticRating = try values.decodeIfPresent(Double.self, forKey: "CriticRating")
self.cumulativeRunTimeTicks = try values.decodeIfPresent(Int.self, forKey: "CumulativeRunTimeTicks")
self.currentProgram = try values.decodeIfPresent(BaseItemDto.self, forKey: "CurrentProgram")
self.customRating = try values.decodeIfPresent(String.self, forKey: "CustomRating")
self.dateCreated = try values.decodeIfPresent(Date.self, forKey: "DateCreated")
self.dateLastMediaAdded = try values.decodeIfPresent(Date.self, forKey: "DateLastMediaAdded")
self.displayOrder = try values.decodeIfPresent(String.self, forKey: "DisplayOrder")
self.displayPreferencesID = try values.decodeIfPresent(String.self, forKey: "DisplayPreferencesId")
self.enableMediaSourceDisplay = try values.decodeIfPresent(Bool.self, forKey: "EnableMediaSourceDisplay")
self.endDate = try values.decodeIfPresent(Date.self, forKey: "EndDate")
self.episodeCount = try values.decodeIfPresent(Int.self, forKey: "EpisodeCount")
self.episodeTitle = try values.decodeIfPresent(String.self, forKey: "EpisodeTitle")
self.etag = try values.decodeIfPresent(String.self, forKey: "Etag")
self.exposureTime = try values.decodeIfPresent(Double.self, forKey: "ExposureTime")
self.externalURLs = try values.decodeIfPresent([ExternalURL].self, forKey: "ExternalUrls")
self.extraType = try values.decodeIfPresent(String.self, forKey: "ExtraType")
self.focalLength = try values.decodeIfPresent(Double.self, forKey: "FocalLength")
self.forcedSortName = try values.decodeIfPresent(String.self, forKey: "ForcedSortName")
self.genreItems = try values.decodeIfPresent([NameGuidPair].self, forKey: "GenreItems")
self.genres = try values.decodeIfPresent([String].self, forKey: "Genres")
self.hasSubtitles = try values.decodeIfPresent(Bool.self, forKey: "HasSubtitles")
self.height = try values.decodeIfPresent(Int.self, forKey: "Height")
self.id = try values.decodeIfPresent(UUID.self, forKey: "Id")
self.imageBlurHashes = try values.decodeIfPresent(ImageBlurHashes.self, forKey: "ImageBlurHashes")
self.imageOrientation = try values.decodeIfPresent(ImageOrientation.self, forKey: "ImageOrientation")
self.imageTags = try values.decodeIfPresent([String: String].self, forKey: "ImageTags")
self.indexNumber = try values.decodeIfPresent(Int.self, forKey: "IndexNumber")
self.indexNumberEnd = try values.decodeIfPresent(Int.self, forKey: "IndexNumberEnd")
self.isFolder = try values.decodeIfPresent(Bool.self, forKey: "IsFolder")
self.isHD = try values.decodeIfPresent(Bool.self, forKey: "IsHD")
self.isKids = try values.decodeIfPresent(Bool.self, forKey: "IsKids")
self.isLive = try values.decodeIfPresent(Bool.self, forKey: "IsLive")
self.isMovie = try values.decodeIfPresent(Bool.self, forKey: "IsMovie")
self.isNews = try values.decodeIfPresent(Bool.self, forKey: "IsNews")
self.isPlaceHolder = try values.decodeIfPresent(Bool.self, forKey: "IsPlaceHolder")
self.isPremiere = try values.decodeIfPresent(Bool.self, forKey: "IsPremiere")
self.isRepeat = try values.decodeIfPresent(Bool.self, forKey: "IsRepeat")
self.isSeries = try values.decodeIfPresent(Bool.self, forKey: "IsSeries")
self.isSports = try values.decodeIfPresent(Bool.self, forKey: "IsSports")
self.isoSpeedRating = try values.decodeIfPresent(Int.self, forKey: "IsoSpeedRating")
self.isoType = try values.decodeIfPresent(IsoType.self, forKey: "IsoType")
self.latitude = try values.decodeIfPresent(Double.self, forKey: "Latitude")
self.localTrailerCount = try values.decodeIfPresent(Int.self, forKey: "LocalTrailerCount")
self.locationType = try values.decodeIfPresent(LocationType.self, forKey: "LocationType")
self.lockData = try values.decodeIfPresent(Bool.self, forKey: "LockData")
self.lockedFields = try values.decodeIfPresent([MetadataField].self, forKey: "LockedFields")
self.longitude = try values.decodeIfPresent(Double.self, forKey: "Longitude")
self.mediaSourceCount = try values.decodeIfPresent(Int.self, forKey: "MediaSourceCount")
self.mediaSources = try values.decodeIfPresent([MediaSourceInfo].self, forKey: "MediaSources")
self.mediaStreams = try values.decodeIfPresent([MediaStream].self, forKey: "MediaStreams")
self.mediaType = try values.decodeIfPresent(String.self, forKey: "MediaType")
self.movieCount = try values.decodeIfPresent(Int.self, forKey: "MovieCount")
self.musicVideoCount = try values.decodeIfPresent(Int.self, forKey: "MusicVideoCount")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.number = try values.decodeIfPresent(String.self, forKey: "Number")
self.officialRating = try values.decodeIfPresent(String.self, forKey: "OfficialRating")
self.originalTitle = try values.decodeIfPresent(String.self, forKey: "OriginalTitle")
self.overview = try values.decodeIfPresent(String.self, forKey: "Overview")
self.parentArtImageTag = try values.decodeIfPresent(String.self, forKey: "ParentArtImageTag")
self.parentArtItemID = try values.decodeIfPresent(UUID.self, forKey: "ParentArtItemId")
self.parentBackdropImageTags = try values.decodeIfPresent([String].self, forKey: "ParentBackdropImageTags")
self.parentBackdropItemID = try values.decodeIfPresent(UUID.self, forKey: "ParentBackdropItemId")
self.parentID = try values.decodeIfPresent(UUID.self, forKey: "ParentId")
self.parentIndexNumber = try values.decodeIfPresent(Int.self, forKey: "ParentIndexNumber")
self.parentLogoImageTag = try values.decodeIfPresent(String.self, forKey: "ParentLogoImageTag")
self.parentLogoItemID = try values.decodeIfPresent(UUID.self, forKey: "ParentLogoItemId")
self.parentPrimaryImageItemID = try values.decodeIfPresent(String.self, forKey: "ParentPrimaryImageItemId")
self.parentPrimaryImageTag = try values.decodeIfPresent(String.self, forKey: "ParentPrimaryImageTag")
self.parentThumbImageTag = try values.decodeIfPresent(String.self, forKey: "ParentThumbImageTag")
self.parentThumbItemID = try values.decodeIfPresent(UUID.self, forKey: "ParentThumbItemId")
self.partCount = try values.decodeIfPresent(Int.self, forKey: "PartCount")
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
self.people = try values.decodeIfPresent([BaseItemPerson].self, forKey: "People")
self.playAccess = try values.decodeIfPresent(PlayAccess.self, forKey: "PlayAccess")
self.playlistItemID = try values.decodeIfPresent(String.self, forKey: "PlaylistItemId")
self.preferredMetadataCountryCode = try values.decodeIfPresent(String.self, forKey: "PreferredMetadataCountryCode")
self.preferredMetadataLanguage = try values.decodeIfPresent(String.self, forKey: "PreferredMetadataLanguage")
self.premiereDate = try values.decodeIfPresent(Date.self, forKey: "PremiereDate")
self.primaryImageAspectRatio = try values.decodeIfPresent(Double.self, forKey: "PrimaryImageAspectRatio")
self.productionLocations = try values.decodeIfPresent([String].self, forKey: "ProductionLocations")
self.productionYear = try values.decodeIfPresent(Int.self, forKey: "ProductionYear")
self.programCount = try values.decodeIfPresent(Int.self, forKey: "ProgramCount")
self.programID = try values.decodeIfPresent(String.self, forKey: "ProgramId")
self.providerIDs = try values.decodeIfPresent([String: String].self, forKey: "ProviderIds")
self.recursiveItemCount = try values.decodeIfPresent(Int.self, forKey: "RecursiveItemCount")
self.remoteTrailers = try values.decodeIfPresent([MediaURL].self, forKey: "RemoteTrailers")
self.runTimeTicks = try values.decodeIfPresent(Int.self, forKey: "RunTimeTicks")
self.screenshotImageTags = try values.decodeIfPresent([String].self, forKey: "ScreenshotImageTags")
self.seasonID = try values.decodeIfPresent(UUID.self, forKey: "SeasonId")
self.seasonName = try values.decodeIfPresent(String.self, forKey: "SeasonName")
self.seriesCount = try values.decodeIfPresent(Int.self, forKey: "SeriesCount")
self.seriesID = try values.decodeIfPresent(UUID.self, forKey: "SeriesId")
self.seriesName = try values.decodeIfPresent(String.self, forKey: "SeriesName")
self.seriesPrimaryImageTag = try values.decodeIfPresent(String.self, forKey: "SeriesPrimaryImageTag")
self.seriesStudio = try values.decodeIfPresent(String.self, forKey: "SeriesStudio")
self.seriesThumbImageTag = try values.decodeIfPresent(String.self, forKey: "SeriesThumbImageTag")
self.seriesTimerID = try values.decodeIfPresent(String.self, forKey: "SeriesTimerId")
self.serverID = try values.decodeIfPresent(String.self, forKey: "ServerId")
self.shutterSpeed = try values.decodeIfPresent(Double.self, forKey: "ShutterSpeed")
self.software = try values.decodeIfPresent(String.self, forKey: "Software")
self.songCount = try values.decodeIfPresent(Int.self, forKey: "SongCount")
self.sortName = try values.decodeIfPresent(String.self, forKey: "SortName")
self.sourceType = try values.decodeIfPresent(String.self, forKey: "SourceType")
self.specialFeatureCount = try values.decodeIfPresent(Int.self, forKey: "SpecialFeatureCount")
self.startDate = try values.decodeIfPresent(Date.self, forKey: "StartDate")
self.status = try values.decodeIfPresent(String.self, forKey: "Status")
self.studios = try values.decodeIfPresent([NameGuidPair].self, forKey: "Studios")
self.isSupportsSync = try values.decodeIfPresent(Bool.self, forKey: "SupportsSync")
self.taglines = try values.decodeIfPresent([String].self, forKey: "Taglines")
self.tags = try values.decodeIfPresent([String].self, forKey: "Tags")
self.timerID = try values.decodeIfPresent(String.self, forKey: "TimerId")
self.trailerCount = try values.decodeIfPresent(Int.self, forKey: "TrailerCount")
self.type = try values.decodeIfPresent(BaseItemKind.self, forKey: "Type")
self.userData = try values.decodeIfPresent(UserItemDataDto.self, forKey: "UserData")
self.video3DFormat = try values.decodeIfPresent(Video3DFormat.self, forKey: "Video3DFormat")
self.videoType = try values.decodeIfPresent(VideoType.self, forKey: "VideoType")
self.width = try values.decodeIfPresent(Int.self, forKey: "Width")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(airDays, forKey: "AirDays")
try values.encodeIfPresent(airTime, forKey: "AirTime")
try values.encodeIfPresent(airsAfterSeasonNumber, forKey: "AirsAfterSeasonNumber")
try values.encodeIfPresent(airsBeforeEpisodeNumber, forKey: "AirsBeforeEpisodeNumber")
try values.encodeIfPresent(airsBeforeSeasonNumber, forKey: "AirsBeforeSeasonNumber")
try values.encodeIfPresent(album, forKey: "Album")
try values.encodeIfPresent(albumArtist, forKey: "AlbumArtist")
try values.encodeIfPresent(albumArtists, forKey: "AlbumArtists")
try values.encodeIfPresent(albumCount, forKey: "AlbumCount")
try values.encodeIfPresent(albumID, forKey: "AlbumId")
try values.encodeIfPresent(albumPrimaryImageTag, forKey: "AlbumPrimaryImageTag")
try values.encodeIfPresent(altitude, forKey: "Altitude")
try values.encodeIfPresent(aperture, forKey: "Aperture")
try values.encodeIfPresent(artistCount, forKey: "ArtistCount")
try values.encodeIfPresent(artistItems, forKey: "ArtistItems")
try values.encodeIfPresent(artists, forKey: "Artists")
try values.encodeIfPresent(aspectRatio, forKey: "AspectRatio")
try values.encodeIfPresent(audio, forKey: "Audio")
try values.encodeIfPresent(backdropImageTags, forKey: "BackdropImageTags")
try values.encodeIfPresent(cameraMake, forKey: "CameraMake")
try values.encodeIfPresent(cameraModel, forKey: "CameraModel")
try values.encodeIfPresent(canDelete, forKey: "CanDelete")
try values.encodeIfPresent(canDownload, forKey: "CanDownload")
try values.encodeIfPresent(channelID, forKey: "ChannelId")
try values.encodeIfPresent(channelName, forKey: "ChannelName")
try values.encodeIfPresent(channelNumber, forKey: "ChannelNumber")
try values.encodeIfPresent(channelPrimaryImageTag, forKey: "ChannelPrimaryImageTag")
try values.encodeIfPresent(channelType, forKey: "ChannelType")
try values.encodeIfPresent(chapters, forKey: "Chapters")
try values.encodeIfPresent(childCount, forKey: "ChildCount")
try values.encodeIfPresent(collectionType, forKey: "CollectionType")
try values.encodeIfPresent(communityRating, forKey: "CommunityRating")
try values.encodeIfPresent(completionPercentage, forKey: "CompletionPercentage")
try values.encodeIfPresent(container, forKey: "Container")
try values.encodeIfPresent(criticRating, forKey: "CriticRating")
try values.encodeIfPresent(cumulativeRunTimeTicks, forKey: "CumulativeRunTimeTicks")
try values.encodeIfPresent(currentProgram, forKey: "CurrentProgram")
try values.encodeIfPresent(customRating, forKey: "CustomRating")
try values.encodeIfPresent(dateCreated, forKey: "DateCreated")
try values.encodeIfPresent(dateLastMediaAdded, forKey: "DateLastMediaAdded")
try values.encodeIfPresent(displayOrder, forKey: "DisplayOrder")
try values.encodeIfPresent(displayPreferencesID, forKey: "DisplayPreferencesId")
try values.encodeIfPresent(enableMediaSourceDisplay, forKey: "EnableMediaSourceDisplay")
try values.encodeIfPresent(endDate, forKey: "EndDate")
try values.encodeIfPresent(episodeCount, forKey: "EpisodeCount")
try values.encodeIfPresent(episodeTitle, forKey: "EpisodeTitle")
try values.encodeIfPresent(etag, forKey: "Etag")
try values.encodeIfPresent(exposureTime, forKey: "ExposureTime")
try values.encodeIfPresent(externalURLs, forKey: "ExternalUrls")
try values.encodeIfPresent(extraType, forKey: "ExtraType")
try values.encodeIfPresent(focalLength, forKey: "FocalLength")
try values.encodeIfPresent(forcedSortName, forKey: "ForcedSortName")
try values.encodeIfPresent(genreItems, forKey: "GenreItems")
try values.encodeIfPresent(genres, forKey: "Genres")
try values.encodeIfPresent(hasSubtitles, forKey: "HasSubtitles")
try values.encodeIfPresent(height, forKey: "Height")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(imageBlurHashes, forKey: "ImageBlurHashes")
try values.encodeIfPresent(imageOrientation, forKey: "ImageOrientation")
try values.encodeIfPresent(imageTags, forKey: "ImageTags")
try values.encodeIfPresent(indexNumber, forKey: "IndexNumber")
try values.encodeIfPresent(indexNumberEnd, forKey: "IndexNumberEnd")
try values.encodeIfPresent(isFolder, forKey: "IsFolder")
try values.encodeIfPresent(isHD, forKey: "IsHD")
try values.encodeIfPresent(isKids, forKey: "IsKids")
try values.encodeIfPresent(isLive, forKey: "IsLive")
try values.encodeIfPresent(isMovie, forKey: "IsMovie")
try values.encodeIfPresent(isNews, forKey: "IsNews")
try values.encodeIfPresent(isPlaceHolder, forKey: "IsPlaceHolder")
try values.encodeIfPresent(isPremiere, forKey: "IsPremiere")
try values.encodeIfPresent(isRepeat, forKey: "IsRepeat")
try values.encodeIfPresent(isSeries, forKey: "IsSeries")
try values.encodeIfPresent(isSports, forKey: "IsSports")
try values.encodeIfPresent(isoSpeedRating, forKey: "IsoSpeedRating")
try values.encodeIfPresent(isoType, forKey: "IsoType")
try values.encodeIfPresent(latitude, forKey: "Latitude")
try values.encodeIfPresent(localTrailerCount, forKey: "LocalTrailerCount")
try values.encodeIfPresent(locationType, forKey: "LocationType")
try values.encodeIfPresent(lockData, forKey: "LockData")
try values.encodeIfPresent(lockedFields, forKey: "LockedFields")
try values.encodeIfPresent(longitude, forKey: "Longitude")
try values.encodeIfPresent(mediaSourceCount, forKey: "MediaSourceCount")
try values.encodeIfPresent(mediaSources, forKey: "MediaSources")
try values.encodeIfPresent(mediaStreams, forKey: "MediaStreams")
try values.encodeIfPresent(mediaType, forKey: "MediaType")
try values.encodeIfPresent(movieCount, forKey: "MovieCount")
try values.encodeIfPresent(musicVideoCount, forKey: "MusicVideoCount")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(number, forKey: "Number")
try values.encodeIfPresent(officialRating, forKey: "OfficialRating")
try values.encodeIfPresent(originalTitle, forKey: "OriginalTitle")
try values.encodeIfPresent(overview, forKey: "Overview")
try values.encodeIfPresent(parentArtImageTag, forKey: "ParentArtImageTag")
try values.encodeIfPresent(parentArtItemID, forKey: "ParentArtItemId")
try values.encodeIfPresent(parentBackdropImageTags, forKey: "ParentBackdropImageTags")
try values.encodeIfPresent(parentBackdropItemID, forKey: "ParentBackdropItemId")
try values.encodeIfPresent(parentID, forKey: "ParentId")
try values.encodeIfPresent(parentIndexNumber, forKey: "ParentIndexNumber")
try values.encodeIfPresent(parentLogoImageTag, forKey: "ParentLogoImageTag")
try values.encodeIfPresent(parentLogoItemID, forKey: "ParentLogoItemId")
try values.encodeIfPresent(parentPrimaryImageItemID, forKey: "ParentPrimaryImageItemId")
try values.encodeIfPresent(parentPrimaryImageTag, forKey: "ParentPrimaryImageTag")
try values.encodeIfPresent(parentThumbImageTag, forKey: "ParentThumbImageTag")
try values.encodeIfPresent(parentThumbItemID, forKey: "ParentThumbItemId")
try values.encodeIfPresent(partCount, forKey: "PartCount")
try values.encodeIfPresent(path, forKey: "Path")
try values.encodeIfPresent(people, forKey: "People")
try values.encodeIfPresent(playAccess, forKey: "PlayAccess")
try values.encodeIfPresent(playlistItemID, forKey: "PlaylistItemId")
try values.encodeIfPresent(preferredMetadataCountryCode, forKey: "PreferredMetadataCountryCode")
try values.encodeIfPresent(preferredMetadataLanguage, forKey: "PreferredMetadataLanguage")
try values.encodeIfPresent(premiereDate, forKey: "PremiereDate")
try values.encodeIfPresent(primaryImageAspectRatio, forKey: "PrimaryImageAspectRatio")
try values.encodeIfPresent(productionLocations, forKey: "ProductionLocations")
try values.encodeIfPresent(productionYear, forKey: "ProductionYear")
try values.encodeIfPresent(programCount, forKey: "ProgramCount")
try values.encodeIfPresent(programID, forKey: "ProgramId")
try values.encodeIfPresent(providerIDs, forKey: "ProviderIds")
try values.encodeIfPresent(recursiveItemCount, forKey: "RecursiveItemCount")
try values.encodeIfPresent(remoteTrailers, forKey: "RemoteTrailers")
try values.encodeIfPresent(runTimeTicks, forKey: "RunTimeTicks")
try values.encodeIfPresent(screenshotImageTags, forKey: "ScreenshotImageTags")
try values.encodeIfPresent(seasonID, forKey: "SeasonId")
try values.encodeIfPresent(seasonName, forKey: "SeasonName")
try values.encodeIfPresent(seriesCount, forKey: "SeriesCount")
try values.encodeIfPresent(seriesID, forKey: "SeriesId")
try values.encodeIfPresent(seriesName, forKey: "SeriesName")
try values.encodeIfPresent(seriesPrimaryImageTag, forKey: "SeriesPrimaryImageTag")
try values.encodeIfPresent(seriesStudio, forKey: "SeriesStudio")
try values.encodeIfPresent(seriesThumbImageTag, forKey: "SeriesThumbImageTag")
try values.encodeIfPresent(seriesTimerID, forKey: "SeriesTimerId")
try values.encodeIfPresent(serverID, forKey: "ServerId")
try values.encodeIfPresent(shutterSpeed, forKey: "ShutterSpeed")
try values.encodeIfPresent(software, forKey: "Software")
try values.encodeIfPresent(songCount, forKey: "SongCount")
try values.encodeIfPresent(sortName, forKey: "SortName")
try values.encodeIfPresent(sourceType, forKey: "SourceType")
try values.encodeIfPresent(specialFeatureCount, forKey: "SpecialFeatureCount")
try values.encodeIfPresent(startDate, forKey: "StartDate")
try values.encodeIfPresent(status, forKey: "Status")
try values.encodeIfPresent(studios, forKey: "Studios")
try values.encodeIfPresent(isSupportsSync, forKey: "SupportsSync")
try values.encodeIfPresent(taglines, forKey: "Taglines")
try values.encodeIfPresent(tags, forKey: "Tags")
try values.encodeIfPresent(timerID, forKey: "TimerId")
try values.encodeIfPresent(trailerCount, forKey: "TrailerCount")
try values.encodeIfPresent(type, forKey: "Type")
try values.encodeIfPresent(userData, forKey: "UserData")
try values.encodeIfPresent(video3DFormat, forKey: "Video3DFormat")
try values.encodeIfPresent(videoType, forKey: "VideoType")
try values.encodeIfPresent(width, forKey: "Width")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -21,18 +21,4 @@ public struct BaseItemDtoQueryResult: Codable {
self.startIndex = startIndex
self.totalRecordCount = totalRecordCount
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.items = try values.decodeIfPresent([BaseItemDto].self, forKey: "Items")
self.startIndex = try values.decodeIfPresent(Int.self, forKey: "StartIndex")
self.totalRecordCount = try values.decodeIfPresent(Int.self, forKey: "TotalRecordCount")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(items, forKey: "Items")
try values.encodeIfPresent(startIndex, forKey: "StartIndex")
try values.encodeIfPresent(totalRecordCount, forKey: "TotalRecordCount")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -68,40 +68,6 @@ public struct BaseItemPerson: Codable, Identifiable {
self.screenshot = screenshot
self.thumb = thumb
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.art = try values.decodeIfPresent([String: String].self, forKey: "Art")
self.backdrop = try values.decodeIfPresent([String: String].self, forKey: "Backdrop")
self.banner = try values.decodeIfPresent([String: String].self, forKey: "Banner")
self.box = try values.decodeIfPresent([String: String].self, forKey: "Box")
self.boxRear = try values.decodeIfPresent([String: String].self, forKey: "BoxRear")
self.chapter = try values.decodeIfPresent([String: String].self, forKey: "Chapter")
self.disc = try values.decodeIfPresent([String: String].self, forKey: "Disc")
self.logo = try values.decodeIfPresent([String: String].self, forKey: "Logo")
self.menu = try values.decodeIfPresent([String: String].self, forKey: "Menu")
self.primary = try values.decodeIfPresent([String: String].self, forKey: "Primary")
self.profile = try values.decodeIfPresent([String: String].self, forKey: "Profile")
self.screenshot = try values.decodeIfPresent([String: String].self, forKey: "Screenshot")
self.thumb = try values.decodeIfPresent([String: String].self, forKey: "Thumb")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(art, forKey: "Art")
try values.encodeIfPresent(backdrop, forKey: "Backdrop")
try values.encodeIfPresent(banner, forKey: "Banner")
try values.encodeIfPresent(box, forKey: "Box")
try values.encodeIfPresent(boxRear, forKey: "BoxRear")
try values.encodeIfPresent(chapter, forKey: "Chapter")
try values.encodeIfPresent(disc, forKey: "Disc")
try values.encodeIfPresent(logo, forKey: "Logo")
try values.encodeIfPresent(menu, forKey: "Menu")
try values.encodeIfPresent(primary, forKey: "Primary")
try values.encodeIfPresent(profile, forKey: "Profile")
try values.encodeIfPresent(screenshot, forKey: "Screenshot")
try values.encodeIfPresent(thumb, forKey: "Thumb")
}
}
public init(
@ -119,24 +85,4 @@ public struct BaseItemPerson: Codable, Identifiable {
self.role = role
self.type = type
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.id = try values.decodeIfPresent(UUID.self, forKey: "Id")
self.imageBlurHashes = try values.decodeIfPresent(ImageBlurHashes.self, forKey: "ImageBlurHashes")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.primaryImageTag = try values.decodeIfPresent(String.self, forKey: "PrimaryImageTag")
self.role = try values.decodeIfPresent(String.self, forKey: "Role")
self.type = try values.decodeIfPresent(String.self, forKey: "Type")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(imageBlurHashes, forKey: "ImageBlurHashes")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(primaryImageTag, forKey: "PrimaryImageTag")
try values.encodeIfPresent(role, forKey: "Role")
try values.encodeIfPresent(type, forKey: "Type")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -56,36 +56,4 @@ public struct BookInfo: Codable {
self.seriesName = seriesName
self.year = year
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.indexNumber = try values.decodeIfPresent(Int.self, forKey: "IndexNumber")
self.isAutomated = try values.decodeIfPresent(Bool.self, forKey: "IsAutomated")
self.metadataCountryCode = try values.decodeIfPresent(String.self, forKey: "MetadataCountryCode")
self.metadataLanguage = try values.decodeIfPresent(String.self, forKey: "MetadataLanguage")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.originalTitle = try values.decodeIfPresent(String.self, forKey: "OriginalTitle")
self.parentIndexNumber = try values.decodeIfPresent(Int.self, forKey: "ParentIndexNumber")
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
self.premiereDate = try values.decodeIfPresent(Date.self, forKey: "PremiereDate")
self.providerIDs = try values.decodeIfPresent([String: String].self, forKey: "ProviderIds")
self.seriesName = try values.decodeIfPresent(String.self, forKey: "SeriesName")
self.year = try values.decodeIfPresent(Int.self, forKey: "Year")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(indexNumber, forKey: "IndexNumber")
try values.encodeIfPresent(isAutomated, forKey: "IsAutomated")
try values.encodeIfPresent(metadataCountryCode, forKey: "MetadataCountryCode")
try values.encodeIfPresent(metadataLanguage, forKey: "MetadataLanguage")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(originalTitle, forKey: "OriginalTitle")
try values.encodeIfPresent(parentIndexNumber, forKey: "ParentIndexNumber")
try values.encodeIfPresent(path, forKey: "Path")
try values.encodeIfPresent(premiereDate, forKey: "PremiereDate")
try values.encodeIfPresent(providerIDs, forKey: "ProviderIds")
try values.encodeIfPresent(seriesName, forKey: "SeriesName")
try values.encodeIfPresent(year, forKey: "Year")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -27,20 +27,4 @@ public struct BookInfoRemoteSearchQuery: Codable {
self.searchInfo = searchInfo
self.searchProviderName = searchProviderName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.isIncludeDisabledProviders = try values.decodeIfPresent(Bool.self, forKey: "IncludeDisabledProviders")
self.itemID = try values.decodeIfPresent(UUID.self, forKey: "ItemId")
self.searchInfo = try values.decodeIfPresent(BookInfo.self, forKey: "SearchInfo")
self.searchProviderName = try values.decodeIfPresent(String.self, forKey: "SearchProviderName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(isIncludeDisabledProviders, forKey: "IncludeDisabledProviders")
try values.encodeIfPresent(itemID, forKey: "ItemId")
try values.encodeIfPresent(searchInfo, forKey: "SearchInfo")
try values.encodeIfPresent(searchProviderName, forKey: "SearchProviderName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -53,34 +53,4 @@ public struct BoxSetInfo: Codable {
self.providerIDs = providerIDs
self.year = year
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.indexNumber = try values.decodeIfPresent(Int.self, forKey: "IndexNumber")
self.isAutomated = try values.decodeIfPresent(Bool.self, forKey: "IsAutomated")
self.metadataCountryCode = try values.decodeIfPresent(String.self, forKey: "MetadataCountryCode")
self.metadataLanguage = try values.decodeIfPresent(String.self, forKey: "MetadataLanguage")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.originalTitle = try values.decodeIfPresent(String.self, forKey: "OriginalTitle")
self.parentIndexNumber = try values.decodeIfPresent(Int.self, forKey: "ParentIndexNumber")
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
self.premiereDate = try values.decodeIfPresent(Date.self, forKey: "PremiereDate")
self.providerIDs = try values.decodeIfPresent([String: String].self, forKey: "ProviderIds")
self.year = try values.decodeIfPresent(Int.self, forKey: "Year")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(indexNumber, forKey: "IndexNumber")
try values.encodeIfPresent(isAutomated, forKey: "IsAutomated")
try values.encodeIfPresent(metadataCountryCode, forKey: "MetadataCountryCode")
try values.encodeIfPresent(metadataLanguage, forKey: "MetadataLanguage")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(originalTitle, forKey: "OriginalTitle")
try values.encodeIfPresent(parentIndexNumber, forKey: "ParentIndexNumber")
try values.encodeIfPresent(path, forKey: "Path")
try values.encodeIfPresent(premiereDate, forKey: "PremiereDate")
try values.encodeIfPresent(providerIDs, forKey: "ProviderIds")
try values.encodeIfPresent(year, forKey: "Year")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -27,20 +27,4 @@ public struct BoxSetInfoRemoteSearchQuery: Codable {
self.searchInfo = searchInfo
self.searchProviderName = searchProviderName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.isIncludeDisabledProviders = try values.decodeIfPresent(Bool.self, forKey: "IncludeDisabledProviders")
self.itemID = try values.decodeIfPresent(UUID.self, forKey: "ItemId")
self.searchInfo = try values.decodeIfPresent(BoxSetInfo.self, forKey: "SearchInfo")
self.searchProviderName = try values.decodeIfPresent(String.self, forKey: "SearchProviderName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(isIncludeDisabledProviders, forKey: "IncludeDisabledProviders")
try values.encodeIfPresent(itemID, forKey: "ItemId")
try values.encodeIfPresent(searchInfo, forKey: "SearchInfo")
try values.encodeIfPresent(searchProviderName, forKey: "SearchProviderName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -22,18 +22,4 @@ public struct BrandingOptions: Codable {
self.loginDisclaimer = loginDisclaimer
self.isSplashscreenEnabled = isSplashscreenEnabled
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.customCss = try values.decodeIfPresent(String.self, forKey: "CustomCss")
self.loginDisclaimer = try values.decodeIfPresent(String.self, forKey: "LoginDisclaimer")
self.isSplashscreenEnabled = try values.decodeIfPresent(Bool.self, forKey: "SplashscreenEnabled")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(customCss, forKey: "CustomCss")
try values.encodeIfPresent(loginDisclaimer, forKey: "LoginDisclaimer")
try values.encodeIfPresent(isSplashscreenEnabled, forKey: "SplashscreenEnabled")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -25,20 +25,4 @@ public struct BufferRequestDto: Codable {
self.positionTicks = positionTicks
self.when = when
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.isPlaying = try values.decodeIfPresent(Bool.self, forKey: "IsPlaying")
self.playlistItemID = try values.decodeIfPresent(UUID.self, forKey: "PlaylistItemId")
self.positionTicks = try values.decodeIfPresent(Int.self, forKey: "PositionTicks")
self.when = try values.decodeIfPresent(Date.self, forKey: "When")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(isPlaying, forKey: "IsPlaying")
try values.encodeIfPresent(playlistItemID, forKey: "PlaylistItemId")
try values.encodeIfPresent(positionTicks, forKey: "PositionTicks")
try values.encodeIfPresent(when, forKey: "When")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -61,36 +61,4 @@ public struct ChannelFeatures: Codable, Identifiable {
self.isSupportsLatestMedia = isSupportsLatestMedia
self.isSupportsSortOrderToggle = isSupportsSortOrderToggle
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.autoRefreshLevels = try values.decodeIfPresent(Int.self, forKey: "AutoRefreshLevels")
self.canFilter = try values.decodeIfPresent(Bool.self, forKey: "CanFilter")
self.canSearch = try values.decodeIfPresent(Bool.self, forKey: "CanSearch")
self.contentTypes = try values.decodeIfPresent([ChannelMediaContentType].self, forKey: "ContentTypes")
self.defaultSortFields = try values.decodeIfPresent([ChannelItemSortField].self, forKey: "DefaultSortFields")
self.id = try values.decodeIfPresent(UUID.self, forKey: "Id")
self.maxPageSize = try values.decodeIfPresent(Int.self, forKey: "MaxPageSize")
self.mediaTypes = try values.decodeIfPresent([ChannelMediaType].self, forKey: "MediaTypes")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.isSupportsContentDownloading = try values.decodeIfPresent(Bool.self, forKey: "SupportsContentDownloading")
self.isSupportsLatestMedia = try values.decodeIfPresent(Bool.self, forKey: "SupportsLatestMedia")
self.isSupportsSortOrderToggle = try values.decodeIfPresent(Bool.self, forKey: "SupportsSortOrderToggle")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(autoRefreshLevels, forKey: "AutoRefreshLevels")
try values.encodeIfPresent(canFilter, forKey: "CanFilter")
try values.encodeIfPresent(canSearch, forKey: "CanSearch")
try values.encodeIfPresent(contentTypes, forKey: "ContentTypes")
try values.encodeIfPresent(defaultSortFields, forKey: "DefaultSortFields")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(maxPageSize, forKey: "MaxPageSize")
try values.encodeIfPresent(mediaTypes, forKey: "MediaTypes")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(isSupportsContentDownloading, forKey: "SupportsContentDownloading")
try values.encodeIfPresent(isSupportsLatestMedia, forKey: "SupportsLatestMedia")
try values.encodeIfPresent(isSupportsSortOrderToggle, forKey: "SupportsSortOrderToggle")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -30,20 +30,4 @@ public struct ChannelMappingOptionsDto: Codable {
self.providerName = providerName
self.tunerChannels = tunerChannels
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.mappings = try values.decodeIfPresent([NameValuePair].self, forKey: "Mappings")
self.providerChannels = try values.decodeIfPresent([NameIDPair].self, forKey: "ProviderChannels")
self.providerName = try values.decodeIfPresent(String.self, forKey: "ProviderName")
self.tunerChannels = try values.decodeIfPresent([TunerChannelMapping].self, forKey: "TunerChannels")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(mappings, forKey: "Mappings")
try values.encodeIfPresent(providerChannels, forKey: "ProviderChannels")
try values.encodeIfPresent(providerName, forKey: "ProviderName")
try values.encodeIfPresent(tunerChannels, forKey: "TunerChannels")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -32,22 +32,4 @@ public struct ChapterInfo: Codable {
self.name = name
self.startPositionTicks = startPositionTicks
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.imageDateModified = try values.decodeIfPresent(Date.self, forKey: "ImageDateModified")
self.imagePath = try values.decodeIfPresent(String.self, forKey: "ImagePath")
self.imageTag = try values.decodeIfPresent(String.self, forKey: "ImageTag")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.startPositionTicks = try values.decodeIfPresent(Int.self, forKey: "StartPositionTicks")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(imageDateModified, forKey: "ImageDateModified")
try values.encodeIfPresent(imagePath, forKey: "ImagePath")
try values.encodeIfPresent(imageTag, forKey: "ImageTag")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(startPositionTicks, forKey: "StartPositionTicks")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -54,32 +54,4 @@ public struct ClientCapabilities: Codable {
self.isSupportsPersistentIdentifier = isSupportsPersistentIdentifier
self.isSupportsSync = isSupportsSync
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.appStoreURL = try values.decodeIfPresent(String.self, forKey: "AppStoreUrl")
self.deviceProfile = try values.decodeIfPresent(DeviceProfile.self, forKey: "DeviceProfile")
self.iconURL = try values.decodeIfPresent(String.self, forKey: "IconUrl")
self.messageCallbackURL = try values.decodeIfPresent(String.self, forKey: "MessageCallbackUrl")
self.playableMediaTypes = try values.decodeIfPresent([String].self, forKey: "PlayableMediaTypes")
self.supportedCommands = try values.decodeIfPresent([GeneralCommandType].self, forKey: "SupportedCommands")
self.isSupportsContentUploading = try values.decodeIfPresent(Bool.self, forKey: "SupportsContentUploading")
self.isSupportsMediaControl = try values.decodeIfPresent(Bool.self, forKey: "SupportsMediaControl")
self.isSupportsPersistentIdentifier = try values.decodeIfPresent(Bool.self, forKey: "SupportsPersistentIdentifier")
self.isSupportsSync = try values.decodeIfPresent(Bool.self, forKey: "SupportsSync")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(appStoreURL, forKey: "AppStoreUrl")
try values.encodeIfPresent(deviceProfile, forKey: "DeviceProfile")
try values.encodeIfPresent(iconURL, forKey: "IconUrl")
try values.encodeIfPresent(messageCallbackURL, forKey: "MessageCallbackUrl")
try values.encodeIfPresent(playableMediaTypes, forKey: "PlayableMediaTypes")
try values.encodeIfPresent(supportedCommands, forKey: "SupportedCommands")
try values.encodeIfPresent(isSupportsContentUploading, forKey: "SupportsContentUploading")
try values.encodeIfPresent(isSupportsMediaControl, forKey: "SupportsMediaControl")
try values.encodeIfPresent(isSupportsPersistentIdentifier, forKey: "SupportsPersistentIdentifier")
try values.encodeIfPresent(isSupportsSync, forKey: "SupportsSync")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -64,32 +64,4 @@ public struct ClientCapabilitiesDto: Codable {
self.isSupportsPersistentIdentifier = isSupportsPersistentIdentifier
self.isSupportsSync = isSupportsSync
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.appStoreURL = try values.decodeIfPresent(String.self, forKey: "AppStoreUrl")
self.deviceProfile = try values.decodeIfPresent(DeviceProfile.self, forKey: "DeviceProfile")
self.iconURL = try values.decodeIfPresent(String.self, forKey: "IconUrl")
self.messageCallbackURL = try values.decodeIfPresent(String.self, forKey: "MessageCallbackUrl")
self.playableMediaTypes = try values.decodeIfPresent([String].self, forKey: "PlayableMediaTypes")
self.supportedCommands = try values.decodeIfPresent([GeneralCommandType].self, forKey: "SupportedCommands")
self.isSupportsContentUploading = try values.decodeIfPresent(Bool.self, forKey: "SupportsContentUploading")
self.isSupportsMediaControl = try values.decodeIfPresent(Bool.self, forKey: "SupportsMediaControl")
self.isSupportsPersistentIdentifier = try values.decodeIfPresent(Bool.self, forKey: "SupportsPersistentIdentifier")
self.isSupportsSync = try values.decodeIfPresent(Bool.self, forKey: "SupportsSync")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(appStoreURL, forKey: "AppStoreUrl")
try values.encodeIfPresent(deviceProfile, forKey: "DeviceProfile")
try values.encodeIfPresent(iconURL, forKey: "IconUrl")
try values.encodeIfPresent(messageCallbackURL, forKey: "MessageCallbackUrl")
try values.encodeIfPresent(playableMediaTypes, forKey: "PlayableMediaTypes")
try values.encodeIfPresent(supportedCommands, forKey: "SupportedCommands")
try values.encodeIfPresent(isSupportsContentUploading, forKey: "SupportsContentUploading")
try values.encodeIfPresent(isSupportsMediaControl, forKey: "SupportsMediaControl")
try values.encodeIfPresent(isSupportsPersistentIdentifier, forKey: "SupportsPersistentIdentifier")
try values.encodeIfPresent(isSupportsSync, forKey: "SupportsSync")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -16,14 +16,4 @@ public struct ClientLogDocumentResponseDto: Codable {
public init(fileName: String? = nil) {
self.fileName = fileName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.fileName = try values.decodeIfPresent(String.self, forKey: "FileName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(fileName, forKey: "FileName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -28,22 +28,4 @@ public struct CodecProfile: Codable {
self.container = container
self.type = type
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.applyConditions = try values.decodeIfPresent([ProfileCondition].self, forKey: "ApplyConditions")
self.codec = try values.decodeIfPresent(String.self, forKey: "Codec")
self.conditions = try values.decodeIfPresent([ProfileCondition].self, forKey: "Conditions")
self.container = try values.decodeIfPresent(String.self, forKey: "Container")
self.type = try values.decodeIfPresent(CodecType.self, forKey: "Type")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(applyConditions, forKey: "ApplyConditions")
try values.encodeIfPresent(codec, forKey: "Codec")
try values.encodeIfPresent(conditions, forKey: "Conditions")
try values.encodeIfPresent(container, forKey: "Container")
try values.encodeIfPresent(type, forKey: "Type")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -14,14 +14,4 @@ public struct CollectionCreationResult: Codable, Identifiable {
public init(id: UUID? = nil) {
self.id = id
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.id = try values.decodeIfPresent(UUID.self, forKey: "Id")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(id, forKey: "Id")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -34,26 +34,4 @@ public struct ConfigImageTypes: Codable {
self.secureBaseURL = secureBaseURL
self.stillSizes = stillSizes
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.backdropSizes = try values.decodeIfPresent([String].self, forKey: "BackdropSizes")
self.baseURL = try values.decodeIfPresent(String.self, forKey: "BaseUrl")
self.logoSizes = try values.decodeIfPresent([String].self, forKey: "LogoSizes")
self.posterSizes = try values.decodeIfPresent([String].self, forKey: "PosterSizes")
self.profileSizes = try values.decodeIfPresent([String].self, forKey: "ProfileSizes")
self.secureBaseURL = try values.decodeIfPresent(String.self, forKey: "SecureBaseUrl")
self.stillSizes = try values.decodeIfPresent([String].self, forKey: "StillSizes")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(backdropSizes, forKey: "BackdropSizes")
try values.encodeIfPresent(baseURL, forKey: "BaseUrl")
try values.encodeIfPresent(logoSizes, forKey: "LogoSizes")
try values.encodeIfPresent(posterSizes, forKey: "PosterSizes")
try values.encodeIfPresent(profileSizes, forKey: "ProfileSizes")
try values.encodeIfPresent(secureBaseURL, forKey: "SecureBaseUrl")
try values.encodeIfPresent(stillSizes, forKey: "StillSizes")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -38,24 +38,4 @@ public struct ConfigurationPageInfo: Codable {
self.name = name
self.pluginID = pluginID
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.displayName = try values.decodeIfPresent(String.self, forKey: "DisplayName")
self.enableInMainMenu = try values.decodeIfPresent(Bool.self, forKey: "EnableInMainMenu")
self.menuIcon = try values.decodeIfPresent(String.self, forKey: "MenuIcon")
self.menuSection = try values.decodeIfPresent(String.self, forKey: "MenuSection")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.pluginID = try values.decodeIfPresent(UUID.self, forKey: "PluginId")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(displayName, forKey: "DisplayName")
try values.encodeIfPresent(enableInMainMenu, forKey: "EnableInMainMenu")
try values.encodeIfPresent(menuIcon, forKey: "MenuIcon")
try values.encodeIfPresent(menuSection, forKey: "MenuSection")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(pluginID, forKey: "PluginId")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -18,18 +18,4 @@ public struct ContainerProfile: Codable {
self.container = container
self.type = type
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.conditions = try values.decodeIfPresent([ProfileCondition].self, forKey: "Conditions")
self.container = try values.decodeIfPresent(String.self, forKey: "Container")
self.type = try values.decodeIfPresent(DlnaProfileType.self, forKey: "Type")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(conditions, forKey: "Conditions")
try values.encodeIfPresent(container, forKey: "Container")
try values.encodeIfPresent(type, forKey: "Type")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -18,18 +18,4 @@ public struct ControlResponse: Codable {
self.isSuccessful = isSuccessful
self.xml = xml
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.headers = try values.decodeIfPresent([String: String].self, forKey: "Headers")
self.isSuccessful = try values.decodeIfPresent(Bool.self, forKey: "IsSuccessful")
self.xml = try values.decodeIfPresent(String.self, forKey: "Xml")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(headers, forKey: "Headers")
try values.encodeIfPresent(isSuccessful, forKey: "IsSuccessful")
try values.encodeIfPresent(xml, forKey: "Xml")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -30,20 +30,4 @@ public struct CountryInfo: Codable {
self.threeLetterISORegionName = threeLetterISORegionName
self.twoLetterISORegionName = twoLetterISORegionName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.displayName = try values.decodeIfPresent(String.self, forKey: "DisplayName")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.threeLetterISORegionName = try values.decodeIfPresent(String.self, forKey: "ThreeLetterISORegionName")
self.twoLetterISORegionName = try values.decodeIfPresent(String.self, forKey: "TwoLetterISORegionName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(displayName, forKey: "DisplayName")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(threeLetterISORegionName, forKey: "ThreeLetterISORegionName")
try values.encodeIfPresent(twoLetterISORegionName, forKey: "TwoLetterISORegionName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -25,20 +25,4 @@ public struct CreatePlaylistDto: Codable {
self.name = name
self.userID = userID
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.ids = try values.decodeIfPresent([UUID].self, forKey: "Ids")
self.mediaType = try values.decodeIfPresent(String.self, forKey: "MediaType")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.userID = try values.decodeIfPresent(UUID.self, forKey: "UserId")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(ids, forKey: "Ids")
try values.encodeIfPresent(mediaType, forKey: "MediaType")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(userID, forKey: "UserId")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -19,16 +19,4 @@ public struct CreateUserByName: Codable {
self.name = name
self.password = password
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.password = try values.decodeIfPresent(String.self, forKey: "Password")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(password, forKey: "Password")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -33,22 +33,4 @@ public struct CultureDto: Codable {
self.threeLetterISOLanguageNames = threeLetterISOLanguageNames
self.twoLetterISOLanguageName = twoLetterISOLanguageName
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.displayName = try values.decodeIfPresent(String.self, forKey: "DisplayName")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.threeLetterISOLanguageName = try values.decodeIfPresent(String.self, forKey: "ThreeLetterISOLanguageName")
self.threeLetterISOLanguageNames = try values.decodeIfPresent([String].self, forKey: "ThreeLetterISOLanguageNames")
self.twoLetterISOLanguageName = try values.decodeIfPresent(String.self, forKey: "TwoLetterISOLanguageName")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(displayName, forKey: "DisplayName")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(threeLetterISOLanguageName, forKey: "ThreeLetterISOLanguageName")
try values.encodeIfPresent(threeLetterISOLanguageNames, forKey: "ThreeLetterISOLanguageNames")
try values.encodeIfPresent(twoLetterISOLanguageName, forKey: "TwoLetterISOLanguageName")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -16,14 +16,4 @@ public struct DefaultDirectoryBrowserInfoDto: Codable {
public init(path: String? = nil) {
self.path = path
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(path, forKey: "Path")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -49,30 +49,4 @@ public struct DeviceIdentification: Codable {
self.modelURL = modelURL
self.serialNumber = serialNumber
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.friendlyName = try values.decodeIfPresent(String.self, forKey: "FriendlyName")
self.headers = try values.decodeIfPresent([HTTPHeaderInfo].self, forKey: "Headers")
self.manufacturer = try values.decodeIfPresent(String.self, forKey: "Manufacturer")
self.manufacturerURL = try values.decodeIfPresent(String.self, forKey: "ManufacturerUrl")
self.modelDescription = try values.decodeIfPresent(String.self, forKey: "ModelDescription")
self.modelName = try values.decodeIfPresent(String.self, forKey: "ModelName")
self.modelNumber = try values.decodeIfPresent(String.self, forKey: "ModelNumber")
self.modelURL = try values.decodeIfPresent(String.self, forKey: "ModelUrl")
self.serialNumber = try values.decodeIfPresent(String.self, forKey: "SerialNumber")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(friendlyName, forKey: "FriendlyName")
try values.encodeIfPresent(headers, forKey: "Headers")
try values.encodeIfPresent(manufacturer, forKey: "Manufacturer")
try values.encodeIfPresent(manufacturerURL, forKey: "ManufacturerUrl")
try values.encodeIfPresent(modelDescription, forKey: "ModelDescription")
try values.encodeIfPresent(modelName, forKey: "ModelName")
try values.encodeIfPresent(modelNumber, forKey: "ModelNumber")
try values.encodeIfPresent(modelURL, forKey: "ModelUrl")
try values.encodeIfPresent(serialNumber, forKey: "SerialNumber")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -51,32 +51,4 @@ public struct DeviceInfo: Codable, Identifiable {
self.lastUserName = lastUserName
self.name = name
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.accessToken = try values.decodeIfPresent(String.self, forKey: "AccessToken")
self.appName = try values.decodeIfPresent(String.self, forKey: "AppName")
self.appVersion = try values.decodeIfPresent(String.self, forKey: "AppVersion")
self.capabilities = try values.decodeIfPresent(ClientCapabilities.self, forKey: "Capabilities")
self.dateLastActivity = try values.decodeIfPresent(Date.self, forKey: "DateLastActivity")
self.iconURL = try values.decodeIfPresent(String.self, forKey: "IconUrl")
self.id = try values.decodeIfPresent(String.self, forKey: "Id")
self.lastUserID = try values.decodeIfPresent(UUID.self, forKey: "LastUserId")
self.lastUserName = try values.decodeIfPresent(String.self, forKey: "LastUserName")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(accessToken, forKey: "AccessToken")
try values.encodeIfPresent(appName, forKey: "AppName")
try values.encodeIfPresent(appVersion, forKey: "AppVersion")
try values.encodeIfPresent(capabilities, forKey: "Capabilities")
try values.encodeIfPresent(dateLastActivity, forKey: "DateLastActivity")
try values.encodeIfPresent(iconURL, forKey: "IconUrl")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(lastUserID, forKey: "LastUserId")
try values.encodeIfPresent(lastUserName, forKey: "LastUserName")
try values.encodeIfPresent(name, forKey: "Name")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -21,18 +21,4 @@ public struct DeviceInfoQueryResult: Codable {
self.startIndex = startIndex
self.totalRecordCount = totalRecordCount
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.items = try values.decodeIfPresent([DeviceInfo].self, forKey: "Items")
self.startIndex = try values.decodeIfPresent(Int.self, forKey: "StartIndex")
self.totalRecordCount = try values.decodeIfPresent(Int.self, forKey: "TotalRecordCount")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(items, forKey: "Items")
try values.encodeIfPresent(startIndex, forKey: "StartIndex")
try values.encodeIfPresent(totalRecordCount, forKey: "TotalRecordCount")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -22,18 +22,4 @@ public struct DeviceOptions: Codable, Identifiable {
self.deviceID = deviceID
self.id = id
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.customName = try values.decodeIfPresent(String.self, forKey: "CustomName")
self.deviceID = try values.decodeIfPresent(String.self, forKey: "DeviceId")
self.id = try values.decodeIfPresent(Int.self, forKey: "Id")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(customName, forKey: "CustomName")
try values.encodeIfPresent(deviceID, forKey: "DeviceId")
try values.encodeIfPresent(id, forKey: "Id")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -22,18 +22,4 @@ public struct DeviceOptionsDto: Codable, Identifiable {
self.deviceID = deviceID
self.id = id
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.customName = try values.decodeIfPresent(String.self, forKey: "CustomName")
self.deviceID = try values.decodeIfPresent(String.self, forKey: "DeviceId")
self.id = try values.decodeIfPresent(Int.self, forKey: "Id")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(customName, forKey: "CustomName")
try values.encodeIfPresent(deviceID, forKey: "DeviceId")
try values.encodeIfPresent(id, forKey: "Id")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -180,90 +180,4 @@ public struct DeviceProfile: Codable, Identifiable {
self.userID = userID
self.xmlRootAttributes = xmlRootAttributes
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.albumArtPn = try values.decodeIfPresent(String.self, forKey: "AlbumArtPn")
self.codecProfiles = try values.decodeIfPresent([CodecProfile].self, forKey: "CodecProfiles")
self.containerProfiles = try values.decodeIfPresent([ContainerProfile].self, forKey: "ContainerProfiles")
self.directPlayProfiles = try values.decodeIfPresent([DirectPlayProfile].self, forKey: "DirectPlayProfiles")
self.enableAlbumArtInDidl = try values.decodeIfPresent(Bool.self, forKey: "EnableAlbumArtInDidl") ?? false
self.enableMSMediaReceiverRegistrar = try values.decodeIfPresent(Bool.self, forKey: "EnableMSMediaReceiverRegistrar") ?? false
self.enableSingleAlbumArtLimit = try values.decodeIfPresent(Bool.self, forKey: "EnableSingleAlbumArtLimit") ?? false
self.enableSingleSubtitleLimit = try values.decodeIfPresent(Bool.self, forKey: "EnableSingleSubtitleLimit") ?? false
self.friendlyName = try values.decodeIfPresent(String.self, forKey: "FriendlyName")
self.id = try values.decodeIfPresent(String.self, forKey: "Id")
self.identification = try values.decodeIfPresent(DeviceIdentification.self, forKey: "Identification")
self.isIgnoreTranscodeByteRangeRequests = try values.decodeIfPresent(Bool.self, forKey: "IgnoreTranscodeByteRangeRequests") ?? false
self.manufacturer = try values.decodeIfPresent(String.self, forKey: "Manufacturer")
self.manufacturerURL = try values.decodeIfPresent(String.self, forKey: "ManufacturerUrl")
self.maxAlbumArtHeight = try values.decodeIfPresent(Int.self, forKey: "MaxAlbumArtHeight")
self.maxAlbumArtWidth = try values.decodeIfPresent(Int.self, forKey: "MaxAlbumArtWidth")
self.maxIconHeight = try values.decodeIfPresent(Int.self, forKey: "MaxIconHeight")
self.maxIconWidth = try values.decodeIfPresent(Int.self, forKey: "MaxIconWidth")
self.maxStaticBitrate = try values.decodeIfPresent(Int.self, forKey: "MaxStaticBitrate")
self.maxStaticMusicBitrate = try values.decodeIfPresent(Int.self, forKey: "MaxStaticMusicBitrate")
self.maxStreamingBitrate = try values.decodeIfPresent(Int.self, forKey: "MaxStreamingBitrate")
self.modelDescription = try values.decodeIfPresent(String.self, forKey: "ModelDescription")
self.modelName = try values.decodeIfPresent(String.self, forKey: "ModelName")
self.modelNumber = try values.decodeIfPresent(String.self, forKey: "ModelNumber")
self.modelURL = try values.decodeIfPresent(String.self, forKey: "ModelUrl")
self.musicStreamingTranscodingBitrate = try values.decodeIfPresent(Int.self, forKey: "MusicStreamingTranscodingBitrate")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.protocolInfo = try values.decodeIfPresent(String.self, forKey: "ProtocolInfo")
self.requiresPlainFolders = try values.decodeIfPresent(Bool.self, forKey: "RequiresPlainFolders") ?? false
self.requiresPlainVideoItems = try values.decodeIfPresent(Bool.self, forKey: "RequiresPlainVideoItems") ?? false
self.responseProfiles = try values.decodeIfPresent([ResponseProfile].self, forKey: "ResponseProfiles")
self.serialNumber = try values.decodeIfPresent(String.self, forKey: "SerialNumber")
self.sonyAggregationFlags = try values.decodeIfPresent(String.self, forKey: "SonyAggregationFlags")
self.subtitleProfiles = try values.decodeIfPresent([SubtitleProfile].self, forKey: "SubtitleProfiles")
self.supportedMediaTypes = try values.decodeIfPresent(String.self, forKey: "SupportedMediaTypes")
self.timelineOffsetSeconds = try values.decodeIfPresent(Int.self, forKey: "TimelineOffsetSeconds")
self.transcodingProfiles = try values.decodeIfPresent([TranscodingProfile].self, forKey: "TranscodingProfiles")
self.userID = try values.decodeIfPresent(String.self, forKey: "UserId")
self.xmlRootAttributes = try values.decodeIfPresent([XmlAttribute].self, forKey: "XmlRootAttributes")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(albumArtPn, forKey: "AlbumArtPn")
try values.encodeIfPresent(codecProfiles, forKey: "CodecProfiles")
try values.encodeIfPresent(containerProfiles, forKey: "ContainerProfiles")
try values.encodeIfPresent(directPlayProfiles, forKey: "DirectPlayProfiles")
try values.encodeIfPresent(enableAlbumArtInDidl, forKey: "EnableAlbumArtInDidl")
try values.encodeIfPresent(enableMSMediaReceiverRegistrar, forKey: "EnableMSMediaReceiverRegistrar")
try values.encodeIfPresent(enableSingleAlbumArtLimit, forKey: "EnableSingleAlbumArtLimit")
try values.encodeIfPresent(enableSingleSubtitleLimit, forKey: "EnableSingleSubtitleLimit")
try values.encodeIfPresent(friendlyName, forKey: "FriendlyName")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(identification, forKey: "Identification")
try values.encodeIfPresent(isIgnoreTranscodeByteRangeRequests, forKey: "IgnoreTranscodeByteRangeRequests")
try values.encodeIfPresent(manufacturer, forKey: "Manufacturer")
try values.encodeIfPresent(manufacturerURL, forKey: "ManufacturerUrl")
try values.encodeIfPresent(maxAlbumArtHeight, forKey: "MaxAlbumArtHeight")
try values.encodeIfPresent(maxAlbumArtWidth, forKey: "MaxAlbumArtWidth")
try values.encodeIfPresent(maxIconHeight, forKey: "MaxIconHeight")
try values.encodeIfPresent(maxIconWidth, forKey: "MaxIconWidth")
try values.encodeIfPresent(maxStaticBitrate, forKey: "MaxStaticBitrate")
try values.encodeIfPresent(maxStaticMusicBitrate, forKey: "MaxStaticMusicBitrate")
try values.encodeIfPresent(maxStreamingBitrate, forKey: "MaxStreamingBitrate")
try values.encodeIfPresent(modelDescription, forKey: "ModelDescription")
try values.encodeIfPresent(modelName, forKey: "ModelName")
try values.encodeIfPresent(modelNumber, forKey: "ModelNumber")
try values.encodeIfPresent(modelURL, forKey: "ModelUrl")
try values.encodeIfPresent(musicStreamingTranscodingBitrate, forKey: "MusicStreamingTranscodingBitrate")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(protocolInfo, forKey: "ProtocolInfo")
try values.encodeIfPresent(requiresPlainFolders, forKey: "RequiresPlainFolders")
try values.encodeIfPresent(requiresPlainVideoItems, forKey: "RequiresPlainVideoItems")
try values.encodeIfPresent(responseProfiles, forKey: "ResponseProfiles")
try values.encodeIfPresent(serialNumber, forKey: "SerialNumber")
try values.encodeIfPresent(sonyAggregationFlags, forKey: "SonyAggregationFlags")
try values.encodeIfPresent(subtitleProfiles, forKey: "SubtitleProfiles")
try values.encodeIfPresent(supportedMediaTypes, forKey: "SupportedMediaTypes")
try values.encodeIfPresent(timelineOffsetSeconds, forKey: "TimelineOffsetSeconds")
try values.encodeIfPresent(transcodingProfiles, forKey: "TranscodingProfiles")
try values.encodeIfPresent(userID, forKey: "UserId")
try values.encodeIfPresent(xmlRootAttributes, forKey: "XmlRootAttributes")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -21,18 +21,4 @@ public struct DeviceProfileInfo: Codable, Identifiable {
self.name = name
self.type = type
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.id = try values.decodeIfPresent(String.self, forKey: "Id")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.type = try values.decodeIfPresent(DeviceProfileType.self, forKey: "Type")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(type, forKey: "Type")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -20,20 +20,4 @@ public struct DirectPlayProfile: Codable {
self.type = type
self.videoCodec = videoCodec
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.audioCodec = try values.decodeIfPresent(String.self, forKey: "AudioCodec")
self.container = try values.decodeIfPresent(String.self, forKey: "Container")
self.type = try values.decodeIfPresent(DlnaProfileType.self, forKey: "Type")
self.videoCodec = try values.decodeIfPresent(String.self, forKey: "VideoCodec")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(audioCodec, forKey: "AudioCodec")
try values.encodeIfPresent(container, forKey: "Container")
try values.encodeIfPresent(type, forKey: "Type")
try values.encodeIfPresent(videoCodec, forKey: "VideoCodec")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -70,40 +70,4 @@ public struct DisplayPreferencesDto: Codable, Identifiable {
self.sortOrder = sortOrder
self.viewType = viewType
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.client = try values.decodeIfPresent(String.self, forKey: "Client")
self.customPrefs = try values.decodeIfPresent([String: String].self, forKey: "CustomPrefs")
self.id = try values.decodeIfPresent(String.self, forKey: "Id")
self.indexBy = try values.decodeIfPresent(String.self, forKey: "IndexBy")
self.primaryImageHeight = try values.decodeIfPresent(Int.self, forKey: "PrimaryImageHeight")
self.primaryImageWidth = try values.decodeIfPresent(Int.self, forKey: "PrimaryImageWidth")
self.isRememberIndexing = try values.decodeIfPresent(Bool.self, forKey: "RememberIndexing")
self.isRememberSorting = try values.decodeIfPresent(Bool.self, forKey: "RememberSorting")
self.scrollDirection = try values.decodeIfPresent(ScrollDirection.self, forKey: "ScrollDirection")
self.isShowBackdrop = try values.decodeIfPresent(Bool.self, forKey: "ShowBackdrop")
self.isShowSidebar = try values.decodeIfPresent(Bool.self, forKey: "ShowSidebar")
self.sortBy = try values.decodeIfPresent(String.self, forKey: "SortBy")
self.sortOrder = try values.decodeIfPresent(SortOrder.self, forKey: "SortOrder")
self.viewType = try values.decodeIfPresent(String.self, forKey: "ViewType")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(client, forKey: "Client")
try values.encodeIfPresent(customPrefs, forKey: "CustomPrefs")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(indexBy, forKey: "IndexBy")
try values.encodeIfPresent(primaryImageHeight, forKey: "PrimaryImageHeight")
try values.encodeIfPresent(primaryImageWidth, forKey: "PrimaryImageWidth")
try values.encodeIfPresent(isRememberIndexing, forKey: "RememberIndexing")
try values.encodeIfPresent(isRememberSorting, forKey: "RememberSorting")
try values.encodeIfPresent(scrollDirection, forKey: "ScrollDirection")
try values.encodeIfPresent(isShowBackdrop, forKey: "ShowBackdrop")
try values.encodeIfPresent(isShowSidebar, forKey: "ShowSidebar")
try values.encodeIfPresent(sortBy, forKey: "SortBy")
try values.encodeIfPresent(sortOrder, forKey: "SortOrder")
try values.encodeIfPresent(viewType, forKey: "ViewType")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -64,34 +64,4 @@ public struct DlnaOptions: Codable {
self.enableServer = enableServer
self.isSendOnlyMatchedHost = isSendOnlyMatchedHost
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.aliveMessageIntervalSeconds = try values.decodeIfPresent(Int.self, forKey: "AliveMessageIntervalSeconds")
self.isAutoCreatePlayToProfiles = try values.decodeIfPresent(Bool.self, forKey: "AutoCreatePlayToProfiles")
self.blastAliveMessageIntervalSeconds = try values.decodeIfPresent(Int.self, forKey: "BlastAliveMessageIntervalSeconds")
self.isBlastAliveMessages = try values.decodeIfPresent(Bool.self, forKey: "BlastAliveMessages")
self.clientDiscoveryIntervalSeconds = try values.decodeIfPresent(Int.self, forKey: "ClientDiscoveryIntervalSeconds")
self.defaultUserID = try values.decodeIfPresent(String.self, forKey: "DefaultUserId")
self.enableDebugLog = try values.decodeIfPresent(Bool.self, forKey: "EnableDebugLog")
self.enablePlayTo = try values.decodeIfPresent(Bool.self, forKey: "EnablePlayTo")
self.enablePlayToTracing = try values.decodeIfPresent(Bool.self, forKey: "EnablePlayToTracing")
self.enableServer = try values.decodeIfPresent(Bool.self, forKey: "EnableServer")
self.isSendOnlyMatchedHost = try values.decodeIfPresent(Bool.self, forKey: "SendOnlyMatchedHost")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(aliveMessageIntervalSeconds, forKey: "AliveMessageIntervalSeconds")
try values.encodeIfPresent(isAutoCreatePlayToProfiles, forKey: "AutoCreatePlayToProfiles")
try values.encodeIfPresent(blastAliveMessageIntervalSeconds, forKey: "BlastAliveMessageIntervalSeconds")
try values.encodeIfPresent(isBlastAliveMessages, forKey: "BlastAliveMessages")
try values.encodeIfPresent(clientDiscoveryIntervalSeconds, forKey: "ClientDiscoveryIntervalSeconds")
try values.encodeIfPresent(defaultUserID, forKey: "DefaultUserId")
try values.encodeIfPresent(enableDebugLog, forKey: "EnableDebugLog")
try values.encodeIfPresent(enablePlayTo, forKey: "EnablePlayTo")
try values.encodeIfPresent(enablePlayToTracing, forKey: "EnablePlayToTracing")
try values.encodeIfPresent(enableServer, forKey: "EnableServer")
try values.encodeIfPresent(isSendOnlyMatchedHost, forKey: "SendOnlyMatchedHost")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -129,94 +129,4 @@ public struct EncodingOptions: Codable {
self.vppTonemappingBrightness = vppTonemappingBrightness
self.vppTonemappingContrast = vppTonemappingContrast
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.allowHevcEncoding = try values.decodeIfPresent(Bool.self, forKey: "AllowHevcEncoding")
self.allowOnDemandMetadataBasedKeyframeExtractionForExtensions = try values.decodeIfPresent(
[String].self,
forKey: "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions"
)
self.isDeinterlaceDoubleRate = try values.decodeIfPresent(Bool.self, forKey: "DeinterlaceDoubleRate")
self.deinterlaceMethod = try values.decodeIfPresent(String.self, forKey: "DeinterlaceMethod")
self.downMixAudioBoost = try values.decodeIfPresent(Double.self, forKey: "DownMixAudioBoost")
self.enableDecodingColorDepth10Hevc = try values.decodeIfPresent(Bool.self, forKey: "EnableDecodingColorDepth10Hevc")
self.enableDecodingColorDepth10Vp9 = try values.decodeIfPresent(Bool.self, forKey: "EnableDecodingColorDepth10Vp9")
self.enableEnhancedNvdecDecoder = try values.decodeIfPresent(Bool.self, forKey: "EnableEnhancedNvdecDecoder")
self.enableFallbackFont = try values.decodeIfPresent(Bool.self, forKey: "EnableFallbackFont")
self.enableHardwareEncoding = try values.decodeIfPresent(Bool.self, forKey: "EnableHardwareEncoding")
self.enableIntelLowPowerH264HwEncoder = try values.decodeIfPresent(Bool.self, forKey: "EnableIntelLowPowerH264HwEncoder")
self.enableIntelLowPowerHevcHwEncoder = try values.decodeIfPresent(Bool.self, forKey: "EnableIntelLowPowerHevcHwEncoder")
self.enableSubtitleExtraction = try values.decodeIfPresent(Bool.self, forKey: "EnableSubtitleExtraction")
self.enableThrottling = try values.decodeIfPresent(Bool.self, forKey: "EnableThrottling")
self.enableTonemapping = try values.decodeIfPresent(Bool.self, forKey: "EnableTonemapping")
self.enableVppTonemapping = try values.decodeIfPresent(Bool.self, forKey: "EnableVppTonemapping")
self.encoderAppPath = try values.decodeIfPresent(String.self, forKey: "EncoderAppPath")
self.encoderAppPathDisplay = try values.decodeIfPresent(String.self, forKey: "EncoderAppPathDisplay")
self.encoderPreset = try values.decodeIfPresent(String.self, forKey: "EncoderPreset")
self.encodingThreadCount = try values.decodeIfPresent(Int.self, forKey: "EncodingThreadCount")
self.fallbackFontPath = try values.decodeIfPresent(String.self, forKey: "FallbackFontPath")
self.h264Crf = try values.decodeIfPresent(Int.self, forKey: "H264Crf")
self.h265Crf = try values.decodeIfPresent(Int.self, forKey: "H265Crf")
self.hardwareAccelerationType = try values.decodeIfPresent(String.self, forKey: "HardwareAccelerationType")
self.hardwareDecodingCodecs = try values.decodeIfPresent([String].self, forKey: "HardwareDecodingCodecs")
self.maxMuxingQueueSize = try values.decodeIfPresent(Int.self, forKey: "MaxMuxingQueueSize")
self.isPreferSystemNativeHwDecoder = try values.decodeIfPresent(Bool.self, forKey: "PreferSystemNativeHwDecoder")
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.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")
self.vppTonemappingContrast = try values.decodeIfPresent(Double.self, forKey: "VppTonemappingContrast")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(allowHevcEncoding, forKey: "AllowHevcEncoding")
try values.encodeIfPresent(
allowOnDemandMetadataBasedKeyframeExtractionForExtensions,
forKey: "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions"
)
try values.encodeIfPresent(isDeinterlaceDoubleRate, forKey: "DeinterlaceDoubleRate")
try values.encodeIfPresent(deinterlaceMethod, forKey: "DeinterlaceMethod")
try values.encodeIfPresent(downMixAudioBoost, forKey: "DownMixAudioBoost")
try values.encodeIfPresent(enableDecodingColorDepth10Hevc, forKey: "EnableDecodingColorDepth10Hevc")
try values.encodeIfPresent(enableDecodingColorDepth10Vp9, forKey: "EnableDecodingColorDepth10Vp9")
try values.encodeIfPresent(enableEnhancedNvdecDecoder, forKey: "EnableEnhancedNvdecDecoder")
try values.encodeIfPresent(enableFallbackFont, forKey: "EnableFallbackFont")
try values.encodeIfPresent(enableHardwareEncoding, forKey: "EnableHardwareEncoding")
try values.encodeIfPresent(enableIntelLowPowerH264HwEncoder, forKey: "EnableIntelLowPowerH264HwEncoder")
try values.encodeIfPresent(enableIntelLowPowerHevcHwEncoder, forKey: "EnableIntelLowPowerHevcHwEncoder")
try values.encodeIfPresent(enableSubtitleExtraction, forKey: "EnableSubtitleExtraction")
try values.encodeIfPresent(enableThrottling, forKey: "EnableThrottling")
try values.encodeIfPresent(enableTonemapping, forKey: "EnableTonemapping")
try values.encodeIfPresent(enableVppTonemapping, forKey: "EnableVppTonemapping")
try values.encodeIfPresent(encoderAppPath, forKey: "EncoderAppPath")
try values.encodeIfPresent(encoderAppPathDisplay, forKey: "EncoderAppPathDisplay")
try values.encodeIfPresent(encoderPreset, forKey: "EncoderPreset")
try values.encodeIfPresent(encodingThreadCount, forKey: "EncodingThreadCount")
try values.encodeIfPresent(fallbackFontPath, forKey: "FallbackFontPath")
try values.encodeIfPresent(h264Crf, forKey: "H264Crf")
try values.encodeIfPresent(h265Crf, forKey: "H265Crf")
try values.encodeIfPresent(hardwareAccelerationType, forKey: "HardwareAccelerationType")
try values.encodeIfPresent(hardwareDecodingCodecs, forKey: "HardwareDecodingCodecs")
try values.encodeIfPresent(maxMuxingQueueSize, forKey: "MaxMuxingQueueSize")
try values.encodeIfPresent(isPreferSystemNativeHwDecoder, forKey: "PreferSystemNativeHwDecoder")
try values.encodeIfPresent(throttleDelaySeconds, forKey: "ThrottleDelaySeconds")
try values.encodeIfPresent(tonemappingAlgorithm, forKey: "TonemappingAlgorithm")
try values.encodeIfPresent(tonemappingDesat, forKey: "TonemappingDesat")
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")
try values.encodeIfPresent(vppTonemappingContrast, forKey: "VppTonemappingContrast")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -16,16 +16,4 @@ public struct EndPointInfo: Codable {
self.isInNetwork = isInNetwork
self.isLocal = isLocal
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.isInNetwork = try values.decodeIfPresent(Bool.self, forKey: "IsInNetwork")
self.isLocal = try values.decodeIfPresent(Bool.self, forKey: "IsLocal")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(isInNetwork, forKey: "IsInNetwork")
try values.encodeIfPresent(isLocal, forKey: "IsLocal")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -31,20 +31,4 @@ public struct ExternalIDInfo: Codable {
self.type = type
self.urlFormatString = urlFormatString
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.key = try values.decodeIfPresent(String.self, forKey: "Key")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.type = try values.decodeIfPresent(ExternalIDMediaType.self, forKey: "Type")
self.urlFormatString = try values.decodeIfPresent(String.self, forKey: "UrlFormatString")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(key, forKey: "Key")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(type, forKey: "Type")
try values.encodeIfPresent(urlFormatString, forKey: "UrlFormatString")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -18,16 +18,4 @@ public struct ExternalURL: Codable {
self.name = name
self.url = url
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.url = try values.decodeIfPresent(String.self, forKey: "Url")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(url, forKey: "Url")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -22,18 +22,4 @@ public struct FileSystemEntryInfo: Codable {
self.path = path
self.type = type
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
self.type = try values.decodeIfPresent(FileSystemEntryType.self, forKey: "Type")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(path, forKey: "Path")
try values.encodeIfPresent(type, forKey: "Type")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -25,20 +25,4 @@ public struct FontFile: Codable {
self.name = name
self.size = size
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.dateCreated = try values.decodeIfPresent(Date.self, forKey: "DateCreated")
self.dateModified = try values.decodeIfPresent(Date.self, forKey: "DateModified")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.size = try values.decodeIfPresent(Int.self, forKey: "Size")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(dateCreated, forKey: "DateCreated")
try values.encodeIfPresent(dateModified, forKey: "DateModified")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(size, forKey: "Size")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -16,14 +16,4 @@ public struct ForgotPasswordDto: Codable {
public init(enteredUsername: String) {
self.enteredUsername = enteredUsername
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.enteredUsername = try values.decode(String.self, forKey: "EnteredUsername")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(enteredUsername, forKey: "EnteredUsername")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -16,14 +16,4 @@ public struct ForgotPasswordPinDto: Codable {
public init(pin: String) {
self.pin = pin
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.pin = try values.decode(String.self, forKey: "Pin")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(pin, forKey: "Pin")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -21,18 +21,4 @@ public struct ForgotPasswordResult: Codable {
self.pinExpirationDate = pinExpirationDate
self.pinFile = pinFile
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.action = try values.decodeIfPresent(ForgotPasswordAction.self, forKey: "Action")
self.pinExpirationDate = try values.decodeIfPresent(Date.self, forKey: "PinExpirationDate")
self.pinFile = try values.decodeIfPresent(String.self, forKey: "PinFile")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(action, forKey: "Action")
try values.encodeIfPresent(pinExpirationDate, forKey: "PinExpirationDate")
try values.encodeIfPresent(pinFile, forKey: "PinFile")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -19,18 +19,4 @@ public struct GeneralCommand: Codable {
self.controllingUserID = controllingUserID
self.name = name
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.arguments = try values.decodeIfPresent([String: String].self, forKey: "Arguments")
self.controllingUserID = try values.decodeIfPresent(UUID.self, forKey: "ControllingUserId")
self.name = try values.decodeIfPresent(GeneralCommandType.self, forKey: "Name")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(arguments, forKey: "Arguments")
try values.encodeIfPresent(controllingUserID, forKey: "ControllingUserId")
try values.encodeIfPresent(name, forKey: "Name")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -164,66 +164,4 @@ public struct GetProgramsDto: Codable {
self.startIndex = startIndex
self.userID = userID
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.channelIDs = try values.decodeIfPresent([UUID].self, forKey: "ChannelIds")
self.enableImageTypes = try values.decodeIfPresent([ImageType].self, forKey: "EnableImageTypes")
self.enableImages = try values.decodeIfPresent(Bool.self, forKey: "EnableImages")
self.enableTotalRecordCount = try values.decodeIfPresent(Bool.self, forKey: "EnableTotalRecordCount")
self.enableUserData = try values.decodeIfPresent(Bool.self, forKey: "EnableUserData")
self.fields = try values.decodeIfPresent([ItemFields].self, forKey: "Fields")
self.genreIDs = try values.decodeIfPresent([UUID].self, forKey: "GenreIds")
self.genres = try values.decodeIfPresent([String].self, forKey: "Genres")
self.hasAired = try values.decodeIfPresent(Bool.self, forKey: "HasAired")
self.imageTypeLimit = try values.decodeIfPresent(Int.self, forKey: "ImageTypeLimit")
self.isAiring = try values.decodeIfPresent(Bool.self, forKey: "IsAiring")
self.isKids = try values.decodeIfPresent(Bool.self, forKey: "IsKids")
self.isMovie = try values.decodeIfPresent(Bool.self, forKey: "IsMovie")
self.isNews = try values.decodeIfPresent(Bool.self, forKey: "IsNews")
self.isSeries = try values.decodeIfPresent(Bool.self, forKey: "IsSeries")
self.isSports = try values.decodeIfPresent(Bool.self, forKey: "IsSports")
self.librarySeriesID = try values.decodeIfPresent(UUID.self, forKey: "LibrarySeriesId")
self.limit = try values.decodeIfPresent(Int.self, forKey: "Limit")
self.maxEndDate = try values.decodeIfPresent(Date.self, forKey: "MaxEndDate")
self.maxStartDate = try values.decodeIfPresent(Date.self, forKey: "MaxStartDate")
self.minEndDate = try values.decodeIfPresent(Date.self, forKey: "MinEndDate")
self.minStartDate = try values.decodeIfPresent(Date.self, forKey: "MinStartDate")
self.seriesTimerID = try values.decodeIfPresent(String.self, forKey: "SeriesTimerId")
self.sortBy = try values.decodeIfPresent([String].self, forKey: "SortBy")
self.sortOrder = try values.decodeIfPresent([SortOrder].self, forKey: "SortOrder")
self.startIndex = try values.decodeIfPresent(Int.self, forKey: "StartIndex")
self.userID = try values.decodeIfPresent(UUID.self, forKey: "UserId")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(channelIDs, forKey: "ChannelIds")
try values.encodeIfPresent(enableImageTypes, forKey: "EnableImageTypes")
try values.encodeIfPresent(enableImages, forKey: "EnableImages")
try values.encodeIfPresent(enableTotalRecordCount, forKey: "EnableTotalRecordCount")
try values.encodeIfPresent(enableUserData, forKey: "EnableUserData")
try values.encodeIfPresent(fields, forKey: "Fields")
try values.encodeIfPresent(genreIDs, forKey: "GenreIds")
try values.encodeIfPresent(genres, forKey: "Genres")
try values.encodeIfPresent(hasAired, forKey: "HasAired")
try values.encodeIfPresent(imageTypeLimit, forKey: "ImageTypeLimit")
try values.encodeIfPresent(isAiring, forKey: "IsAiring")
try values.encodeIfPresent(isKids, forKey: "IsKids")
try values.encodeIfPresent(isMovie, forKey: "IsMovie")
try values.encodeIfPresent(isNews, forKey: "IsNews")
try values.encodeIfPresent(isSeries, forKey: "IsSeries")
try values.encodeIfPresent(isSports, forKey: "IsSports")
try values.encodeIfPresent(librarySeriesID, forKey: "LibrarySeriesId")
try values.encodeIfPresent(limit, forKey: "Limit")
try values.encodeIfPresent(maxEndDate, forKey: "MaxEndDate")
try values.encodeIfPresent(maxStartDate, forKey: "MaxStartDate")
try values.encodeIfPresent(minEndDate, forKey: "MinEndDate")
try values.encodeIfPresent(minStartDate, forKey: "MinStartDate")
try values.encodeIfPresent(seriesTimerID, forKey: "SeriesTimerId")
try values.encodeIfPresent(sortBy, forKey: "SortBy")
try values.encodeIfPresent(sortOrder, forKey: "SortOrder")
try values.encodeIfPresent(startIndex, forKey: "StartIndex")
try values.encodeIfPresent(userID, forKey: "UserId")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -34,22 +34,4 @@ public struct GroupInfoDto: Codable {
self.participants = participants
self.state = state
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.groupID = try values.decodeIfPresent(UUID.self, forKey: "GroupId")
self.groupName = try values.decodeIfPresent(String.self, forKey: "GroupName")
self.lastUpdatedAt = try values.decodeIfPresent(Date.self, forKey: "LastUpdatedAt")
self.participants = try values.decodeIfPresent([String].self, forKey: "Participants")
self.state = try values.decodeIfPresent(GroupStateType.self, forKey: "State")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(groupID, forKey: "GroupId")
try values.encodeIfPresent(groupName, forKey: "GroupName")
try values.encodeIfPresent(lastUpdatedAt, forKey: "LastUpdatedAt")
try values.encodeIfPresent(participants, forKey: "Participants")
try values.encodeIfPresent(state, forKey: "State")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -18,16 +18,4 @@ public struct GuideInfo: Codable {
self.endDate = endDate
self.startDate = startDate
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.endDate = try values.decodeIfPresent(Date.self, forKey: "EndDate")
self.startDate = try values.decodeIfPresent(Date.self, forKey: "StartDate")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(endDate, forKey: "EndDate")
try values.encodeIfPresent(startDate, forKey: "StartDate")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -18,18 +18,4 @@ public struct HTTPHeaderInfo: Codable {
self.name = name
self.value = value
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.match = try values.decodeIfPresent(HeaderMatchType.self, forKey: "Match")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.value = try values.decodeIfPresent(String.self, forKey: "Value")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(match, forKey: "Match")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(value, forKey: "Value")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -42,26 +42,4 @@ public struct IPlugin: Codable, Identifiable {
self.name = name
self.version = version
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.assemblyFilePath = try values.decodeIfPresent(String.self, forKey: "AssemblyFilePath")
self.canUninstall = try values.decodeIfPresent(Bool.self, forKey: "CanUninstall")
self.dataFolderPath = try values.decodeIfPresent(String.self, forKey: "DataFolderPath")
self.description = try values.decodeIfPresent(String.self, forKey: "Description")
self.id = try values.decodeIfPresent(UUID.self, forKey: "Id")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.version = try values.decodeIfPresent(String.self, forKey: "Version")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(assemblyFilePath, forKey: "AssemblyFilePath")
try values.encodeIfPresent(canUninstall, forKey: "CanUninstall")
try values.encodeIfPresent(dataFolderPath, forKey: "DataFolderPath")
try values.encodeIfPresent(description, forKey: "Description")
try values.encodeIfPresent(id, forKey: "Id")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(version, forKey: "Version")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -16,14 +16,4 @@ public struct IgnoreWaitRequestDto: Codable {
public init(isIgnoreWait: Bool? = nil) {
self.isIgnoreWait = isIgnoreWait
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.isIgnoreWait = try values.decodeIfPresent(Bool.self, forKey: "IgnoreWait")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(isIgnoreWait, forKey: "IgnoreWait")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -27,22 +27,4 @@ public struct ImageByNameInfo: Codable {
self.name = name
self.theme = theme
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.context = try values.decodeIfPresent(String.self, forKey: "Context")
self.fileLength = try values.decodeIfPresent(Int.self, forKey: "FileLength")
self.format = try values.decodeIfPresent(String.self, forKey: "Format")
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
self.theme = try values.decodeIfPresent(String.self, forKey: "Theme")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(context, forKey: "Context")
try values.encodeIfPresent(fileLength, forKey: "FileLength")
try values.encodeIfPresent(format, forKey: "Format")
try values.encodeIfPresent(name, forKey: "Name")
try values.encodeIfPresent(theme, forKey: "Theme")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -46,28 +46,4 @@ public struct ImageInfo: Codable {
self.size = size
self.width = width
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.blurHash = try values.decodeIfPresent(String.self, forKey: "BlurHash")
self.height = try values.decodeIfPresent(Int.self, forKey: "Height")
self.imageIndex = try values.decodeIfPresent(Int.self, forKey: "ImageIndex")
self.imageTag = try values.decodeIfPresent(String.self, forKey: "ImageTag")
self.imageType = try values.decodeIfPresent(ImageType.self, forKey: "ImageType")
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
self.size = try values.decodeIfPresent(Int.self, forKey: "Size")
self.width = try values.decodeIfPresent(Int.self, forKey: "Width")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(blurHash, forKey: "BlurHash")
try values.encodeIfPresent(height, forKey: "Height")
try values.encodeIfPresent(imageIndex, forKey: "ImageIndex")
try values.encodeIfPresent(imageTag, forKey: "ImageTag")
try values.encodeIfPresent(imageType, forKey: "ImageType")
try values.encodeIfPresent(path, forKey: "Path")
try values.encodeIfPresent(size, forKey: "Size")
try values.encodeIfPresent(width, forKey: "Width")
}
}

View File

@ -1,5 +1,5 @@
//
// Swiftfin is subject to the terms of the Mozilla Public
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
@ -21,18 +21,4 @@ public struct ImageOption: Codable {
self.minWidth = minWidth
self.type = type
}
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.limit = try values.decodeIfPresent(Int.self, forKey: "Limit")
self.minWidth = try values.decodeIfPresent(Int.self, forKey: "MinWidth")
self.type = try values.decodeIfPresent(ImageType.self, forKey: "Type")
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(limit, forKey: "Limit")
try values.encodeIfPresent(minWidth, forKey: "MinWidth")
try values.encodeIfPresent(type, forKey: "Type")
}
}

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