mirror of
https://github.com/jellyfin/jellyfin-sdk-swift.git
synced 2024-11-23 06:09:58 +00:00
update with decodable inits
This commit is contained in:
parent
7c620c54e8
commit
45a5b3487e
@ -28,4 +28,22 @@ 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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,32 @@ 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(Int64.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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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(Int32.self, forKey: "StartIndex")
|
||||
self.totalRecordCount = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -49,4 +49,40 @@ 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(Int32.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(Int32.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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -43,4 +43,36 @@ 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(Int32.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(Int32.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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -46,4 +46,36 @@ 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(Int64.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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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(Int32.self, forKey: "StartIndex")
|
||||
self.totalRecordCount = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,34 @@ 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(Int32.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(Int64.self, forKey: "Size")
|
||||
self.isSupportsExternalTransfer = try values.decodeIfPresent(Bool.self, forKey: "SupportsExternalTransfer")
|
||||
self.width = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -313,6 +313,40 @@ public struct 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(airDays: [DayOfWeek]? = nil, airTime: String? = nil, airsAfterSeasonNumber: Int32? = nil, airsBeforeEpisodeNumber: Int32? = nil, airsBeforeSeasonNumber: Int32? = nil, album: String? = nil, albumArtist: String? = nil, albumArtists: [NameGuidPair]? = nil, albumCount: Int32? = nil, albumID: UUID? = nil, albumPrimaryImageTag: String? = nil, altitude: Double? = nil, aperture: Double? = nil, artistCount: Int32? = nil, artistItems: [NameGuidPair]? = nil, artists: [String]? = nil, aspectRatio: String? = nil, audio: ProgramAudio? = nil, backdropImageTags: [String]? = nil, cameraMake: String? = nil, cameraModel: String? = nil, canDelete: Bool? = nil, canDownload: Bool? = nil, channelID: UUID? = nil, channelName: String? = nil, channelNumber: String? = nil, channelPrimaryImageTag: String? = nil, channelType: ChannelType? = nil, chapters: [ChapterInfo]? = nil, childCount: Int32? = nil, collectionType: String? = nil, communityRating: Float? = nil, completionPercentage: Double? = nil, container: String? = nil, criticRating: Float? = nil, cumulativeRunTimeTicks: Int64? = nil, customRating: String? = nil, dateCreated: Date? = nil, dateLastMediaAdded: Date? = nil, displayOrder: String? = nil, displayPreferencesID: String? = nil, enableMediaSourceDisplay: Bool? = nil, endDate: Date? = nil, episodeCount: Int32? = nil, episodeTitle: String? = nil, etag: String? = nil, exposureTime: Double? = nil, externalURLs: [ExternalURL]? = nil, extraType: String? = nil, focalLength: Double? = nil, forcedSortName: String? = nil, genreItems: [NameGuidPair]? = nil, genres: [String]? = nil, hasSubtitles: Bool? = nil, height: Int32? = nil, id: UUID? = nil, imageBlurHashes: ImageBlurHashes? = nil, imageOrientation: ImageOrientation? = nil, imageTags: [String: String]? = nil, indexNumber: Int32? = nil, indexNumberEnd: Int32? = nil, isFolder: Bool? = nil, isHD: Bool? = nil, isKids: Bool? = nil, isLive: Bool? = nil, isMovie: Bool? = nil, isNews: Bool? = nil, isPlaceHolder: Bool? = nil, isPremiere: Bool? = nil, isRepeat: Bool? = nil, isSeries: Bool? = nil, isSports: Bool? = nil, isoSpeedRating: Int32? = nil, isoType: IsoType? = nil, latitude: Double? = nil, localTrailerCount: Int32? = nil, locationType: LocationType? = nil, lockData: Bool? = nil, lockedFields: [MetadataField]? = nil, longitude: Double? = nil, mediaSourceCount: Int32? = nil, mediaSources: [MediaSourceInfo]? = nil, mediaStreams: [MediaStream]? = nil, mediaType: String? = nil, movieCount: Int32? = nil, musicVideoCount: Int32? = nil, name: String? = nil, number: String? = nil, officialRating: String? = nil, originalTitle: String? = nil, overview: String? = nil, parentArtImageTag: String? = nil, parentArtItemID: UUID? = nil, parentBackdropImageTags: [String]? = nil, parentBackdropItemID: UUID? = nil, parentID: UUID? = nil, parentIndexNumber: Int32? = nil, parentLogoImageTag: String? = nil, parentLogoItemID: UUID? = nil, parentPrimaryImageItemID: String? = nil, parentPrimaryImageTag: String? = nil, parentThumbImageTag: String? = nil, parentThumbItemID: UUID? = nil, partCount: Int32? = nil, path: String? = nil, people: [BaseItemPerson]? = nil, playAccess: PlayAccess? = nil, playlistItemID: String? = nil, preferredMetadataCountryCode: String? = nil, preferredMetadataLanguage: String? = nil, premiereDate: Date? = nil, primaryImageAspectRatio: Double? = nil, productionLocations: [String]? = nil, productionYear: Int32? = nil, programCount: Int32? = nil, programID: String? = nil, providerIDs: [String: String]? = nil, recursiveItemCount: Int32? = nil, remoteTrailers: [MediaURL]? = nil, runTimeTicks: Int64? = nil, screenshotImageTags: [String]? = nil, seasonID: UUID? = nil, seasonName: String? = nil, seriesCount: Int32? = nil, seriesID: UUID? = nil, seriesName: String? = nil, seriesPrimaryImageTag: String? = nil, seriesStudio: String? = nil, seriesThumbImageTag: String? = nil, seriesTimerID: String? = nil, serverID: String? = nil, shutterSpeed: Double? = nil, software: String? = nil, songCount: Int32? = nil, sortName: String? = nil, sourceType: String? = nil, specialFeatureCount: Int32? = nil, startDate: Date? = nil, status: String? = nil, studios: [NameGuidPair]? = nil, isSupportsSync: Bool? = nil, taglines: [String]? = nil, tags: [String]? = nil, timerID: String? = nil, trailerCount: Int32? = nil, type: BaseItemKind? = nil, userData: UserItemDataDto? = nil, video3DFormat: Video3DFormat? = nil, videoType: VideoType? = nil, width: Int32? = nil) {
|
||||
@ -467,4 +501,312 @@ public struct 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(Int32.self, forKey: "AirsAfterSeasonNumber")
|
||||
self.airsBeforeEpisodeNumber = try values.decodeIfPresent(Int32.self, forKey: "AirsBeforeEpisodeNumber")
|
||||
self.airsBeforeSeasonNumber = try values.decodeIfPresent(Int32.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(Int32.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(Int32.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(Int32.self, forKey: "ChildCount")
|
||||
self.collectionType = try values.decodeIfPresent(String.self, forKey: "CollectionType")
|
||||
self.communityRating = try values.decodeIfPresent(Float.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(Float.self, forKey: "CriticRating")
|
||||
self.cumulativeRunTimeTicks = try values.decodeIfPresent(Int64.self, forKey: "CumulativeRunTimeTicks")
|
||||
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(Int32.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(Int32.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(Int32.self, forKey: "IndexNumber")
|
||||
self.indexNumberEnd = try values.decodeIfPresent(Int32.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(Int32.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(Int32.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(Int32.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(Int32.self, forKey: "MovieCount")
|
||||
self.musicVideoCount = try values.decodeIfPresent(Int32.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(Int32.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(Int32.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(Int32.self, forKey: "ProductionYear")
|
||||
self.programCount = try values.decodeIfPresent(Int32.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(Int32.self, forKey: "RecursiveItemCount")
|
||||
self.remoteTrailers = try values.decodeIfPresent([MediaURL].self, forKey: "RemoteTrailers")
|
||||
self.runTimeTicks = try values.decodeIfPresent(Int64.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(Int32.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(Int32.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(Int32.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(Int32.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(Int32.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(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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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(Int32.self, forKey: "StartIndex")
|
||||
self.totalRecordCount = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,40 @@ 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(id: UUID? = nil, imageBlurHashes: ImageBlurHashes? = nil, name: String? = nil, primaryImageTag: String? = nil, role: String? = nil, type: String? = nil) {
|
||||
@ -64,4 +98,24 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -43,4 +43,36 @@ 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(Int32.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(Int32.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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -41,4 +41,34 @@ 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(Int32.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(Int32.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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,20 @@ 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(Int64.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")
|
||||
}
|
||||
}
|
||||
|
@ -48,4 +48,36 @@ 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(Int32.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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -26,4 +26,22 @@ 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(Int64.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")
|
||||
}
|
||||
}
|
||||
|
@ -43,4 +43,32 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -53,4 +53,32 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,22 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,14 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -26,4 +26,26 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -31,4 +31,24 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -18,4 +18,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -18,4 +18,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,16 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,22 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -39,4 +39,30 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -40,4 +40,32 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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(Int32.self, forKey: "StartIndex")
|
||||
self.totalRecordCount = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,18 @@ 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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,18 @@ 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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -140,4 +140,90 @@ 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(Int32.self, forKey: "MaxAlbumArtHeight")
|
||||
self.maxAlbumArtWidth = try values.decodeIfPresent(Int32.self, forKey: "MaxAlbumArtWidth")
|
||||
self.maxIconHeight = try values.decodeIfPresent(Int32.self, forKey: "MaxIconHeight")
|
||||
self.maxIconWidth = try values.decodeIfPresent(Int32.self, forKey: "MaxIconWidth")
|
||||
self.maxStaticBitrate = try values.decodeIfPresent(Int32.self, forKey: "MaxStaticBitrate")
|
||||
self.maxStaticMusicBitrate = try values.decodeIfPresent(Int32.self, forKey: "MaxStaticMusicBitrate")
|
||||
self.maxStreamingBitrate = try values.decodeIfPresent(Int32.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(Int32.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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -55,4 +55,40 @@ 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(Int32.self, forKey: "PrimaryImageHeight")
|
||||
self.primaryImageWidth = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -52,4 +52,34 @@ 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(Int32.self, forKey: "AliveMessageIntervalSeconds")
|
||||
self.isAutoCreatePlayToProfiles = try values.decodeIfPresent(Bool.self, forKey: "AutoCreatePlayToProfiles")
|
||||
self.blastAliveMessageIntervalSeconds = try values.decodeIfPresent(Int32.self, forKey: "BlastAliveMessageIntervalSeconds")
|
||||
self.isBlastAliveMessages = try values.decodeIfPresent(Bool.self, forKey: "BlastAliveMessages")
|
||||
self.clientDiscoveryIntervalSeconds = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -90,4 +90,88 @@ 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(Int32.self, forKey: "EncodingThreadCount")
|
||||
self.fallbackFontPath = try values.decodeIfPresent(String.self, forKey: "FallbackFontPath")
|
||||
self.h264Crf = try values.decodeIfPresent(Int32.self, forKey: "H264Crf")
|
||||
self.h265Crf = try values.decodeIfPresent(Int32.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(Int32.self, forKey: "MaxMuxingQueueSize")
|
||||
self.isPreferSystemNativeHwDecoder = try values.decodeIfPresent(Bool.self, forKey: "PreferSystemNativeHwDecoder")
|
||||
self.throttleDelaySeconds = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,16 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -31,4 +31,20 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -18,4 +18,16 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,20 @@ 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(Int64.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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -136,4 +136,66 @@ 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(Int32.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(Int32.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(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,22 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -18,4 +18,16 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -18,4 +18,18 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -34,4 +34,26 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ 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")
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,22 @@ 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(Int64.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")
|
||||
}
|
||||
}
|
||||
|
@ -37,4 +37,28 @@ 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(Int32.self, forKey: "Height")
|
||||
self.imageIndex = try values.decodeIfPresent(Int32.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(Int64.self, forKey: "Size")
|
||||
self.width = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ 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(Int32.self, forKey: "Limit")
|
||||
self.minWidth = try values.decodeIfPresent(Int32.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")
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,16 @@ public struct ImageProviderInfo: Codable {
|
||||
self.name = name
|
||||
self.supportedImages = supportedImages
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
|
||||
self.supportedImages = try values.decodeIfPresent([ImageType].self, forKey: "SupportedImages")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(name, forKey: "Name")
|
||||
try values.encodeIfPresent(supportedImages, forKey: "SupportedImages")
|
||||
}
|
||||
}
|
||||
|
@ -34,4 +34,26 @@ public struct InstallationInfo: Codable {
|
||||
self.sourceURL = sourceURL
|
||||
self.version = version
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.changelog = try values.decodeIfPresent(String.self, forKey: "Changelog")
|
||||
self.checksum = try values.decodeIfPresent(String.self, forKey: "Checksum")
|
||||
self.guid = try values.decodeIfPresent(UUID.self, forKey: "Guid")
|
||||
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
|
||||
self.packageInfo = try values.decodeIfPresent(PackageInfo.self, forKey: "PackageInfo")
|
||||
self.sourceURL = try values.decodeIfPresent(String.self, forKey: "SourceUrl")
|
||||
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(changelog, forKey: "Changelog")
|
||||
try values.encodeIfPresent(checksum, forKey: "Checksum")
|
||||
try values.encodeIfPresent(guid, forKey: "Guid")
|
||||
try values.encodeIfPresent(name, forKey: "Name")
|
||||
try values.encodeIfPresent(packageInfo, forKey: "PackageInfo")
|
||||
try values.encodeIfPresent(sourceURL, forKey: "SourceUrl")
|
||||
try values.encodeIfPresent(version, forKey: "Version")
|
||||
}
|
||||
}
|
||||
|
@ -49,4 +49,36 @@ public struct ItemCounts: Codable {
|
||||
self.songCount = songCount
|
||||
self.trailerCount = trailerCount
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.albumCount = try values.decodeIfPresent(Int32.self, forKey: "AlbumCount")
|
||||
self.artistCount = try values.decodeIfPresent(Int32.self, forKey: "ArtistCount")
|
||||
self.bookCount = try values.decodeIfPresent(Int32.self, forKey: "BookCount")
|
||||
self.boxSetCount = try values.decodeIfPresent(Int32.self, forKey: "BoxSetCount")
|
||||
self.episodeCount = try values.decodeIfPresent(Int32.self, forKey: "EpisodeCount")
|
||||
self.itemCount = try values.decodeIfPresent(Int32.self, forKey: "ItemCount")
|
||||
self.movieCount = try values.decodeIfPresent(Int32.self, forKey: "MovieCount")
|
||||
self.musicVideoCount = try values.decodeIfPresent(Int32.self, forKey: "MusicVideoCount")
|
||||
self.programCount = try values.decodeIfPresent(Int32.self, forKey: "ProgramCount")
|
||||
self.seriesCount = try values.decodeIfPresent(Int32.self, forKey: "SeriesCount")
|
||||
self.songCount = try values.decodeIfPresent(Int32.self, forKey: "SongCount")
|
||||
self.trailerCount = try values.decodeIfPresent(Int32.self, forKey: "TrailerCount")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(albumCount, forKey: "AlbumCount")
|
||||
try values.encodeIfPresent(artistCount, forKey: "ArtistCount")
|
||||
try values.encodeIfPresent(bookCount, forKey: "BookCount")
|
||||
try values.encodeIfPresent(boxSetCount, forKey: "BoxSetCount")
|
||||
try values.encodeIfPresent(episodeCount, forKey: "EpisodeCount")
|
||||
try values.encodeIfPresent(itemCount, forKey: "ItemCount")
|
||||
try values.encodeIfPresent(movieCount, forKey: "MovieCount")
|
||||
try values.encodeIfPresent(musicVideoCount, forKey: "MusicVideoCount")
|
||||
try values.encodeIfPresent(programCount, forKey: "ProgramCount")
|
||||
try values.encodeIfPresent(seriesCount, forKey: "SeriesCount")
|
||||
try values.encodeIfPresent(songCount, forKey: "SongCount")
|
||||
try values.encodeIfPresent(trailerCount, forKey: "TrailerCount")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ public struct JoinGroupRequestDto: Codable {
|
||||
public init(groupID: UUID? = nil) {
|
||||
self.groupID = groupID
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.groupID = try values.decodeIfPresent(UUID.self, forKey: "GroupId")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(groupID, forKey: "GroupId")
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,16 @@ public struct LibraryOptionInfoDto: Codable {
|
||||
self.isDefaultEnabled = isDefaultEnabled
|
||||
self.name = name
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.isDefaultEnabled = try values.decodeIfPresent(Bool.self, forKey: "DefaultEnabled")
|
||||
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(isDefaultEnabled, forKey: "DefaultEnabled")
|
||||
try values.encodeIfPresent(name, forKey: "Name")
|
||||
}
|
||||
}
|
||||
|
@ -70,4 +70,66 @@ public struct LibraryOptions: Codable {
|
||||
self.subtitleFetcherOrder = subtitleFetcherOrder
|
||||
self.typeOptions = typeOptions
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.allowEmbeddedSubtitles = try values.decodeIfPresent(EmbeddedSubtitleOptions.self, forKey: "AllowEmbeddedSubtitles")
|
||||
self.automaticRefreshIntervalDays = try values.decodeIfPresent(Int32.self, forKey: "AutomaticRefreshIntervalDays")
|
||||
self.isAutomaticallyAddToCollection = try values.decodeIfPresent(Bool.self, forKey: "AutomaticallyAddToCollection")
|
||||
self.disabledLocalMetadataReaders = try values.decodeIfPresent([String].self, forKey: "DisabledLocalMetadataReaders")
|
||||
self.disabledSubtitleFetchers = try values.decodeIfPresent([String].self, forKey: "DisabledSubtitleFetchers")
|
||||
self.enableAutomaticSeriesGrouping = try values.decodeIfPresent(Bool.self, forKey: "EnableAutomaticSeriesGrouping")
|
||||
self.enableChapterImageExtraction = try values.decodeIfPresent(Bool.self, forKey: "EnableChapterImageExtraction")
|
||||
self.enableEmbeddedEpisodeInfos = try values.decodeIfPresent(Bool.self, forKey: "EnableEmbeddedEpisodeInfos")
|
||||
self.enableEmbeddedTitles = try values.decodeIfPresent(Bool.self, forKey: "EnableEmbeddedTitles")
|
||||
self.enableInternetProviders = try values.decodeIfPresent(Bool.self, forKey: "EnableInternetProviders")
|
||||
self.enablePhotos = try values.decodeIfPresent(Bool.self, forKey: "EnablePhotos")
|
||||
self.enableRealtimeMonitor = try values.decodeIfPresent(Bool.self, forKey: "EnableRealtimeMonitor")
|
||||
self.isExtractChapterImagesDuringLibraryScan = try values.decodeIfPresent(Bool.self, forKey: "ExtractChapterImagesDuringLibraryScan")
|
||||
self.localMetadataReaderOrder = try values.decodeIfPresent([String].self, forKey: "LocalMetadataReaderOrder")
|
||||
self.metadataCountryCode = try values.decodeIfPresent(String.self, forKey: "MetadataCountryCode")
|
||||
self.metadataSavers = try values.decodeIfPresent([String].self, forKey: "MetadataSavers")
|
||||
self.pathInfos = try values.decodeIfPresent([MediaPathInfo].self, forKey: "PathInfos")
|
||||
self.preferredMetadataLanguage = try values.decodeIfPresent(String.self, forKey: "PreferredMetadataLanguage")
|
||||
self.requirePerfectSubtitleMatch = try values.decodeIfPresent(Bool.self, forKey: "RequirePerfectSubtitleMatch")
|
||||
self.isSaveLocalMetadata = try values.decodeIfPresent(Bool.self, forKey: "SaveLocalMetadata")
|
||||
self.isSaveSubtitlesWithMedia = try values.decodeIfPresent(Bool.self, forKey: "SaveSubtitlesWithMedia")
|
||||
self.seasonZeroDisplayName = try values.decodeIfPresent(String.self, forKey: "SeasonZeroDisplayName")
|
||||
self.isSkipSubtitlesIfAudioTrackMatches = try values.decodeIfPresent(Bool.self, forKey: "SkipSubtitlesIfAudioTrackMatches")
|
||||
self.isSkipSubtitlesIfEmbeddedSubtitlesPresent = try values.decodeIfPresent(Bool.self, forKey: "SkipSubtitlesIfEmbeddedSubtitlesPresent")
|
||||
self.subtitleDownloadLanguages = try values.decodeIfPresent([String].self, forKey: "SubtitleDownloadLanguages")
|
||||
self.subtitleFetcherOrder = try values.decodeIfPresent([String].self, forKey: "SubtitleFetcherOrder")
|
||||
self.typeOptions = try values.decodeIfPresent([TypeOptions].self, forKey: "TypeOptions")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(allowEmbeddedSubtitles, forKey: "AllowEmbeddedSubtitles")
|
||||
try values.encodeIfPresent(automaticRefreshIntervalDays, forKey: "AutomaticRefreshIntervalDays")
|
||||
try values.encodeIfPresent(isAutomaticallyAddToCollection, forKey: "AutomaticallyAddToCollection")
|
||||
try values.encodeIfPresent(disabledLocalMetadataReaders, forKey: "DisabledLocalMetadataReaders")
|
||||
try values.encodeIfPresent(disabledSubtitleFetchers, forKey: "DisabledSubtitleFetchers")
|
||||
try values.encodeIfPresent(enableAutomaticSeriesGrouping, forKey: "EnableAutomaticSeriesGrouping")
|
||||
try values.encodeIfPresent(enableChapterImageExtraction, forKey: "EnableChapterImageExtraction")
|
||||
try values.encodeIfPresent(enableEmbeddedEpisodeInfos, forKey: "EnableEmbeddedEpisodeInfos")
|
||||
try values.encodeIfPresent(enableEmbeddedTitles, forKey: "EnableEmbeddedTitles")
|
||||
try values.encodeIfPresent(enableInternetProviders, forKey: "EnableInternetProviders")
|
||||
try values.encodeIfPresent(enablePhotos, forKey: "EnablePhotos")
|
||||
try values.encodeIfPresent(enableRealtimeMonitor, forKey: "EnableRealtimeMonitor")
|
||||
try values.encodeIfPresent(isExtractChapterImagesDuringLibraryScan, forKey: "ExtractChapterImagesDuringLibraryScan")
|
||||
try values.encodeIfPresent(localMetadataReaderOrder, forKey: "LocalMetadataReaderOrder")
|
||||
try values.encodeIfPresent(metadataCountryCode, forKey: "MetadataCountryCode")
|
||||
try values.encodeIfPresent(metadataSavers, forKey: "MetadataSavers")
|
||||
try values.encodeIfPresent(pathInfos, forKey: "PathInfos")
|
||||
try values.encodeIfPresent(preferredMetadataLanguage, forKey: "PreferredMetadataLanguage")
|
||||
try values.encodeIfPresent(requirePerfectSubtitleMatch, forKey: "RequirePerfectSubtitleMatch")
|
||||
try values.encodeIfPresent(isSaveLocalMetadata, forKey: "SaveLocalMetadata")
|
||||
try values.encodeIfPresent(isSaveSubtitlesWithMedia, forKey: "SaveSubtitlesWithMedia")
|
||||
try values.encodeIfPresent(seasonZeroDisplayName, forKey: "SeasonZeroDisplayName")
|
||||
try values.encodeIfPresent(isSkipSubtitlesIfAudioTrackMatches, forKey: "SkipSubtitlesIfAudioTrackMatches")
|
||||
try values.encodeIfPresent(isSkipSubtitlesIfEmbeddedSubtitlesPresent, forKey: "SkipSubtitlesIfEmbeddedSubtitlesPresent")
|
||||
try values.encodeIfPresent(subtitleDownloadLanguages, forKey: "SubtitleDownloadLanguages")
|
||||
try values.encodeIfPresent(subtitleFetcherOrder, forKey: "SubtitleFetcherOrder")
|
||||
try values.encodeIfPresent(typeOptions, forKey: "TypeOptions")
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,20 @@ public struct LibraryOptionsResultDto: Codable {
|
||||
self.subtitleFetchers = subtitleFetchers
|
||||
self.typeOptions = typeOptions
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.metadataReaders = try values.decodeIfPresent([LibraryOptionInfoDto].self, forKey: "MetadataReaders")
|
||||
self.metadataSavers = try values.decodeIfPresent([LibraryOptionInfoDto].self, forKey: "MetadataSavers")
|
||||
self.subtitleFetchers = try values.decodeIfPresent([LibraryOptionInfoDto].self, forKey: "SubtitleFetchers")
|
||||
self.typeOptions = try values.decodeIfPresent([LibraryTypeOptionsDto].self, forKey: "TypeOptions")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(metadataReaders, forKey: "MetadataReaders")
|
||||
try values.encodeIfPresent(metadataSavers, forKey: "MetadataSavers")
|
||||
try values.encodeIfPresent(subtitleFetchers, forKey: "SubtitleFetchers")
|
||||
try values.encodeIfPresent(typeOptions, forKey: "TypeOptions")
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,22 @@ public struct LibraryTypeOptionsDto: Codable {
|
||||
self.supportedImageTypes = supportedImageTypes
|
||||
self.type = type
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.defaultImageOptions = try values.decodeIfPresent([ImageOption].self, forKey: "DefaultImageOptions")
|
||||
self.imageFetchers = try values.decodeIfPresent([LibraryOptionInfoDto].self, forKey: "ImageFetchers")
|
||||
self.metadataFetchers = try values.decodeIfPresent([LibraryOptionInfoDto].self, forKey: "MetadataFetchers")
|
||||
self.supportedImageTypes = try values.decodeIfPresent([ImageType].self, forKey: "SupportedImageTypes")
|
||||
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(defaultImageOptions, forKey: "DefaultImageOptions")
|
||||
try values.encodeIfPresent(imageFetchers, forKey: "ImageFetchers")
|
||||
try values.encodeIfPresent(metadataFetchers, forKey: "MetadataFetchers")
|
||||
try values.encodeIfPresent(supportedImageTypes, forKey: "SupportedImageTypes")
|
||||
try values.encodeIfPresent(type, forKey: "Type")
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,26 @@ public struct LibraryUpdateInfo: Codable {
|
||||
self.itemsRemoved = itemsRemoved
|
||||
self.itemsUpdated = itemsUpdated
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.collectionFolders = try values.decodeIfPresent([String].self, forKey: "CollectionFolders")
|
||||
self.foldersAddedTo = try values.decodeIfPresent([String].self, forKey: "FoldersAddedTo")
|
||||
self.foldersRemovedFrom = try values.decodeIfPresent([String].self, forKey: "FoldersRemovedFrom")
|
||||
self.isEmpty = try values.decodeIfPresent(Bool.self, forKey: "IsEmpty")
|
||||
self.itemsAdded = try values.decodeIfPresent([String].self, forKey: "ItemsAdded")
|
||||
self.itemsRemoved = try values.decodeIfPresent([String].self, forKey: "ItemsRemoved")
|
||||
self.itemsUpdated = try values.decodeIfPresent([String].self, forKey: "ItemsUpdated")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(collectionFolders, forKey: "CollectionFolders")
|
||||
try values.encodeIfPresent(foldersAddedTo, forKey: "FoldersAddedTo")
|
||||
try values.encodeIfPresent(foldersRemovedFrom, forKey: "FoldersRemovedFrom")
|
||||
try values.encodeIfPresent(isEmpty, forKey: "IsEmpty")
|
||||
try values.encodeIfPresent(itemsAdded, forKey: "ItemsAdded")
|
||||
try values.encodeIfPresent(itemsRemoved, forKey: "ItemsRemoved")
|
||||
try values.encodeIfPresent(itemsUpdated, forKey: "ItemsUpdated")
|
||||
}
|
||||
}
|
||||
|
@ -48,4 +48,48 @@ public struct ListingsProviderInfo: Codable, Identifiable {
|
||||
self.username = username
|
||||
self.zipCode = zipCode
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.channelMappings = try values.decodeIfPresent([NameValuePair].self, forKey: "ChannelMappings")
|
||||
self.country = try values.decodeIfPresent(String.self, forKey: "Country")
|
||||
self.enableAllTuners = try values.decodeIfPresent(Bool.self, forKey: "EnableAllTuners")
|
||||
self.enabledTuners = try values.decodeIfPresent([String].self, forKey: "EnabledTuners")
|
||||
self.id = try values.decodeIfPresent(String.self, forKey: "Id")
|
||||
self.kidsCategories = try values.decodeIfPresent([String].self, forKey: "KidsCategories")
|
||||
self.listingsID = try values.decodeIfPresent(String.self, forKey: "ListingsId")
|
||||
self.movieCategories = try values.decodeIfPresent([String].self, forKey: "MovieCategories")
|
||||
self.moviePrefix = try values.decodeIfPresent(String.self, forKey: "MoviePrefix")
|
||||
self.newsCategories = try values.decodeIfPresent([String].self, forKey: "NewsCategories")
|
||||
self.password = try values.decodeIfPresent(String.self, forKey: "Password")
|
||||
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
|
||||
self.preferredLanguage = try values.decodeIfPresent(String.self, forKey: "PreferredLanguage")
|
||||
self.sportsCategories = try values.decodeIfPresent([String].self, forKey: "SportsCategories")
|
||||
self.type = try values.decodeIfPresent(String.self, forKey: "Type")
|
||||
self.userAgent = try values.decodeIfPresent(String.self, forKey: "UserAgent")
|
||||
self.username = try values.decodeIfPresent(String.self, forKey: "Username")
|
||||
self.zipCode = try values.decodeIfPresent(String.self, forKey: "ZipCode")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(channelMappings, forKey: "ChannelMappings")
|
||||
try values.encodeIfPresent(country, forKey: "Country")
|
||||
try values.encodeIfPresent(enableAllTuners, forKey: "EnableAllTuners")
|
||||
try values.encodeIfPresent(enabledTuners, forKey: "EnabledTuners")
|
||||
try values.encodeIfPresent(id, forKey: "Id")
|
||||
try values.encodeIfPresent(kidsCategories, forKey: "KidsCategories")
|
||||
try values.encodeIfPresent(listingsID, forKey: "ListingsId")
|
||||
try values.encodeIfPresent(movieCategories, forKey: "MovieCategories")
|
||||
try values.encodeIfPresent(moviePrefix, forKey: "MoviePrefix")
|
||||
try values.encodeIfPresent(newsCategories, forKey: "NewsCategories")
|
||||
try values.encodeIfPresent(password, forKey: "Password")
|
||||
try values.encodeIfPresent(path, forKey: "Path")
|
||||
try values.encodeIfPresent(preferredLanguage, forKey: "PreferredLanguage")
|
||||
try values.encodeIfPresent(sportsCategories, forKey: "SportsCategories")
|
||||
try values.encodeIfPresent(type, forKey: "Type")
|
||||
try values.encodeIfPresent(userAgent, forKey: "UserAgent")
|
||||
try values.encodeIfPresent(username, forKey: "Username")
|
||||
try values.encodeIfPresent(zipCode, forKey: "ZipCode")
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,14 @@ public struct LiveStreamResponse: Codable {
|
||||
public init(mediaSource: MediaSourceInfo? = nil) {
|
||||
self.mediaSource = mediaSource
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.mediaSource = try values.decodeIfPresent(MediaSourceInfo.self, forKey: "MediaSource")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(mediaSource, forKey: "MediaSource")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,18 @@ public struct LiveTvInfo: Codable {
|
||||
self.isEnabled = isEnabled
|
||||
self.services = services
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.enabledUsers = try values.decodeIfPresent([String].self, forKey: "EnabledUsers")
|
||||
self.isEnabled = try values.decodeIfPresent(Bool.self, forKey: "IsEnabled")
|
||||
self.services = try values.decodeIfPresent([LiveTvServiceInfo].self, forKey: "Services")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(enabledUsers, forKey: "EnabledUsers")
|
||||
try values.encodeIfPresent(isEnabled, forKey: "IsEnabled")
|
||||
try values.encodeIfPresent(services, forKey: "Services")
|
||||
}
|
||||
}
|
||||
|
@ -38,4 +38,38 @@ public struct LiveTvOptions: Codable {
|
||||
self.seriesRecordingPath = seriesRecordingPath
|
||||
self.tunerHosts = tunerHosts
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.enableOriginalAudioWithEncodedRecordings = try values.decodeIfPresent(Bool.self, forKey: "EnableOriginalAudioWithEncodedRecordings")
|
||||
self.enableRecordingSubfolders = try values.decodeIfPresent(Bool.self, forKey: "EnableRecordingSubfolders")
|
||||
self.guideDays = try values.decodeIfPresent(Int32.self, forKey: "GuideDays")
|
||||
self.listingProviders = try values.decodeIfPresent([ListingsProviderInfo].self, forKey: "ListingProviders")
|
||||
self.mediaLocationsCreated = try values.decodeIfPresent([String].self, forKey: "MediaLocationsCreated")
|
||||
self.movieRecordingPath = try values.decodeIfPresent(String.self, forKey: "MovieRecordingPath")
|
||||
self.postPaddingSeconds = try values.decodeIfPresent(Int32.self, forKey: "PostPaddingSeconds")
|
||||
self.prePaddingSeconds = try values.decodeIfPresent(Int32.self, forKey: "PrePaddingSeconds")
|
||||
self.recordingPath = try values.decodeIfPresent(String.self, forKey: "RecordingPath")
|
||||
self.recordingPostProcessor = try values.decodeIfPresent(String.self, forKey: "RecordingPostProcessor")
|
||||
self.recordingPostProcessorArguments = try values.decodeIfPresent(String.self, forKey: "RecordingPostProcessorArguments")
|
||||
self.seriesRecordingPath = try values.decodeIfPresent(String.self, forKey: "SeriesRecordingPath")
|
||||
self.tunerHosts = try values.decodeIfPresent([TunerHostInfo].self, forKey: "TunerHosts")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(enableOriginalAudioWithEncodedRecordings, forKey: "EnableOriginalAudioWithEncodedRecordings")
|
||||
try values.encodeIfPresent(enableRecordingSubfolders, forKey: "EnableRecordingSubfolders")
|
||||
try values.encodeIfPresent(guideDays, forKey: "GuideDays")
|
||||
try values.encodeIfPresent(listingProviders, forKey: "ListingProviders")
|
||||
try values.encodeIfPresent(mediaLocationsCreated, forKey: "MediaLocationsCreated")
|
||||
try values.encodeIfPresent(movieRecordingPath, forKey: "MovieRecordingPath")
|
||||
try values.encodeIfPresent(postPaddingSeconds, forKey: "PostPaddingSeconds")
|
||||
try values.encodeIfPresent(prePaddingSeconds, forKey: "PrePaddingSeconds")
|
||||
try values.encodeIfPresent(recordingPath, forKey: "RecordingPath")
|
||||
try values.encodeIfPresent(recordingPostProcessor, forKey: "RecordingPostProcessor")
|
||||
try values.encodeIfPresent(recordingPostProcessorArguments, forKey: "RecordingPostProcessorArguments")
|
||||
try values.encodeIfPresent(seriesRecordingPath, forKey: "SeriesRecordingPath")
|
||||
try values.encodeIfPresent(tunerHosts, forKey: "TunerHosts")
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,28 @@ public struct LiveTvServiceInfo: Codable {
|
||||
self.tuners = tuners
|
||||
self.version = version
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.hasUpdateAvailable = try values.decodeIfPresent(Bool.self, forKey: "HasUpdateAvailable")
|
||||
self.homePageURL = try values.decodeIfPresent(String.self, forKey: "HomePageUrl")
|
||||
self.isVisible = try values.decodeIfPresent(Bool.self, forKey: "IsVisible")
|
||||
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
|
||||
self.status = try values.decodeIfPresent(LiveTvServiceStatus.self, forKey: "Status")
|
||||
self.statusMessage = try values.decodeIfPresent(String.self, forKey: "StatusMessage")
|
||||
self.tuners = try values.decodeIfPresent([String].self, forKey: "Tuners")
|
||||
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(hasUpdateAvailable, forKey: "HasUpdateAvailable")
|
||||
try values.encodeIfPresent(homePageURL, forKey: "HomePageUrl")
|
||||
try values.encodeIfPresent(isVisible, forKey: "IsVisible")
|
||||
try values.encodeIfPresent(name, forKey: "Name")
|
||||
try values.encodeIfPresent(status, forKey: "Status")
|
||||
try values.encodeIfPresent(statusMessage, forKey: "StatusMessage")
|
||||
try values.encodeIfPresent(tuners, forKey: "Tuners")
|
||||
try values.encodeIfPresent(version, forKey: "Version")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,16 @@ public struct LocalizationOption: Codable {
|
||||
self.name = name
|
||||
self.value = value
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
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(name, forKey: "Name")
|
||||
try values.encodeIfPresent(value, forKey: "Value")
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,20 @@ public struct LogFile: 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(Int64.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")
|
||||
}
|
||||
}
|
||||
|
@ -34,4 +34,26 @@ public struct MediaAttachment: Codable {
|
||||
self.index = index
|
||||
self.mimeType = mimeType
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.codec = try values.decodeIfPresent(String.self, forKey: "Codec")
|
||||
self.codecTag = try values.decodeIfPresent(String.self, forKey: "CodecTag")
|
||||
self.comment = try values.decodeIfPresent(String.self, forKey: "Comment")
|
||||
self.deliveryURL = try values.decodeIfPresent(String.self, forKey: "DeliveryUrl")
|
||||
self.fileName = try values.decodeIfPresent(String.self, forKey: "FileName")
|
||||
self.index = try values.decodeIfPresent(Int32.self, forKey: "Index")
|
||||
self.mimeType = try values.decodeIfPresent(String.self, forKey: "MimeType")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(codec, forKey: "Codec")
|
||||
try values.encodeIfPresent(codecTag, forKey: "CodecTag")
|
||||
try values.encodeIfPresent(comment, forKey: "Comment")
|
||||
try values.encodeIfPresent(deliveryURL, forKey: "DeliveryUrl")
|
||||
try values.encodeIfPresent(fileName, forKey: "FileName")
|
||||
try values.encodeIfPresent(index, forKey: "Index")
|
||||
try values.encodeIfPresent(mimeType, forKey: "MimeType")
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,16 @@ public struct MediaEncoderPathDto: Codable {
|
||||
self.path = path
|
||||
self.pathType = pathType
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
|
||||
self.pathType = try values.decodeIfPresent(String.self, forKey: "PathType")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(path, forKey: "Path")
|
||||
try values.encodeIfPresent(pathType, forKey: "PathType")
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,18 @@ public struct MediaPathDto: Codable {
|
||||
self.path = path
|
||||
self.pathInfo = pathInfo
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.name = try values.decode(String.self, forKey: "Name")
|
||||
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
|
||||
self.pathInfo = try values.decodeIfPresent(MediaPathInfo.self, forKey: "PathInfo")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encode(name, forKey: "Name")
|
||||
try values.encodeIfPresent(path, forKey: "Path")
|
||||
try values.encodeIfPresent(pathInfo, forKey: "PathInfo")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,16 @@ public struct MediaPathInfo: Codable {
|
||||
self.networkPath = networkPath
|
||||
self.path = path
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.networkPath = try values.decodeIfPresent(String.self, forKey: "NetworkPath")
|
||||
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(networkPath, forKey: "NetworkPath")
|
||||
try values.encodeIfPresent(path, forKey: "Path")
|
||||
}
|
||||
}
|
||||
|
@ -99,4 +99,96 @@ public struct MediaSourceInfo: Codable, Identifiable {
|
||||
self.video3DFormat = video3DFormat
|
||||
self.videoType = videoType
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.analyzeDurationMs = try values.decodeIfPresent(Int32.self, forKey: "AnalyzeDurationMs")
|
||||
self.bitrate = try values.decodeIfPresent(Int32.self, forKey: "Bitrate")
|
||||
self.bufferMs = try values.decodeIfPresent(Int32.self, forKey: "BufferMs")
|
||||
self.container = try values.decodeIfPresent(String.self, forKey: "Container")
|
||||
self.defaultAudioStreamIndex = try values.decodeIfPresent(Int32.self, forKey: "DefaultAudioStreamIndex")
|
||||
self.defaultSubtitleStreamIndex = try values.decodeIfPresent(Int32.self, forKey: "DefaultSubtitleStreamIndex")
|
||||
self.eTag = try values.decodeIfPresent(String.self, forKey: "ETag")
|
||||
self.encoderPath = try values.decodeIfPresent(String.self, forKey: "EncoderPath")
|
||||
self.encoderProtocol = try values.decodeIfPresent(MediaProtocol.self, forKey: "EncoderProtocol")
|
||||
self.formats = try values.decodeIfPresent([String].self, forKey: "Formats")
|
||||
self.isGenPtsInput = try values.decodeIfPresent(Bool.self, forKey: "GenPtsInput")
|
||||
self.id = try values.decodeIfPresent(String.self, forKey: "Id")
|
||||
self.isIgnoreDts = try values.decodeIfPresent(Bool.self, forKey: "IgnoreDts")
|
||||
self.isIgnoreIndex = try values.decodeIfPresent(Bool.self, forKey: "IgnoreIndex")
|
||||
self.isInfiniteStream = try values.decodeIfPresent(Bool.self, forKey: "IsInfiniteStream")
|
||||
self.isRemote = try values.decodeIfPresent(Bool.self, forKey: "IsRemote")
|
||||
self.isoType = try values.decodeIfPresent(IsoType.self, forKey: "IsoType")
|
||||
self.liveStreamID = try values.decodeIfPresent(String.self, forKey: "LiveStreamId")
|
||||
self.mediaAttachments = try values.decodeIfPresent([MediaAttachment].self, forKey: "MediaAttachments")
|
||||
self.mediaStreams = try values.decodeIfPresent([MediaStream].self, forKey: "MediaStreams")
|
||||
self.name = try values.decodeIfPresent(String.self, forKey: "Name")
|
||||
self.openToken = try values.decodeIfPresent(String.self, forKey: "OpenToken")
|
||||
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
|
||||
self.protocol = try values.decodeIfPresent(MediaProtocol.self, forKey: "Protocol")
|
||||
self.isReadAtNativeFramerate = try values.decodeIfPresent(Bool.self, forKey: "ReadAtNativeFramerate")
|
||||
self.requiredHTTPHeaders = try values.decodeIfPresent([String: String].self, forKey: "RequiredHttpHeaders")
|
||||
self.requiresClosing = try values.decodeIfPresent(Bool.self, forKey: "RequiresClosing")
|
||||
self.requiresLooping = try values.decodeIfPresent(Bool.self, forKey: "RequiresLooping")
|
||||
self.requiresOpening = try values.decodeIfPresent(Bool.self, forKey: "RequiresOpening")
|
||||
self.runTimeTicks = try values.decodeIfPresent(Int64.self, forKey: "RunTimeTicks")
|
||||
self.size = try values.decodeIfPresent(Int64.self, forKey: "Size")
|
||||
self.isSupportsDirectPlay = try values.decodeIfPresent(Bool.self, forKey: "SupportsDirectPlay")
|
||||
self.isSupportsDirectStream = try values.decodeIfPresent(Bool.self, forKey: "SupportsDirectStream")
|
||||
self.isSupportsProbing = try values.decodeIfPresent(Bool.self, forKey: "SupportsProbing")
|
||||
self.isSupportsTranscoding = try values.decodeIfPresent(Bool.self, forKey: "SupportsTranscoding")
|
||||
self.timestamp = try values.decodeIfPresent(TransportStreamTimestamp.self, forKey: "Timestamp")
|
||||
self.transcodingContainer = try values.decodeIfPresent(String.self, forKey: "TranscodingContainer")
|
||||
self.transcodingSubProtocol = try values.decodeIfPresent(String.self, forKey: "TranscodingSubProtocol")
|
||||
self.transcodingURL = try values.decodeIfPresent(String.self, forKey: "TranscodingUrl")
|
||||
self.type = try values.decodeIfPresent(MediaSourceType.self, forKey: "Type")
|
||||
self.video3DFormat = try values.decodeIfPresent(Video3DFormat.self, forKey: "Video3DFormat")
|
||||
self.videoType = try values.decodeIfPresent(VideoType.self, forKey: "VideoType")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(analyzeDurationMs, forKey: "AnalyzeDurationMs")
|
||||
try values.encodeIfPresent(bitrate, forKey: "Bitrate")
|
||||
try values.encodeIfPresent(bufferMs, forKey: "BufferMs")
|
||||
try values.encodeIfPresent(container, forKey: "Container")
|
||||
try values.encodeIfPresent(defaultAudioStreamIndex, forKey: "DefaultAudioStreamIndex")
|
||||
try values.encodeIfPresent(defaultSubtitleStreamIndex, forKey: "DefaultSubtitleStreamIndex")
|
||||
try values.encodeIfPresent(eTag, forKey: "ETag")
|
||||
try values.encodeIfPresent(encoderPath, forKey: "EncoderPath")
|
||||
try values.encodeIfPresent(encoderProtocol, forKey: "EncoderProtocol")
|
||||
try values.encodeIfPresent(formats, forKey: "Formats")
|
||||
try values.encodeIfPresent(isGenPtsInput, forKey: "GenPtsInput")
|
||||
try values.encodeIfPresent(id, forKey: "Id")
|
||||
try values.encodeIfPresent(isIgnoreDts, forKey: "IgnoreDts")
|
||||
try values.encodeIfPresent(isIgnoreIndex, forKey: "IgnoreIndex")
|
||||
try values.encodeIfPresent(isInfiniteStream, forKey: "IsInfiniteStream")
|
||||
try values.encodeIfPresent(isRemote, forKey: "IsRemote")
|
||||
try values.encodeIfPresent(isoType, forKey: "IsoType")
|
||||
try values.encodeIfPresent(liveStreamID, forKey: "LiveStreamId")
|
||||
try values.encodeIfPresent(mediaAttachments, forKey: "MediaAttachments")
|
||||
try values.encodeIfPresent(mediaStreams, forKey: "MediaStreams")
|
||||
try values.encodeIfPresent(name, forKey: "Name")
|
||||
try values.encodeIfPresent(openToken, forKey: "OpenToken")
|
||||
try values.encodeIfPresent(path, forKey: "Path")
|
||||
try values.encodeIfPresent(`protocol`, forKey: "Protocol")
|
||||
try values.encodeIfPresent(isReadAtNativeFramerate, forKey: "ReadAtNativeFramerate")
|
||||
try values.encodeIfPresent(requiredHTTPHeaders, forKey: "RequiredHttpHeaders")
|
||||
try values.encodeIfPresent(requiresClosing, forKey: "RequiresClosing")
|
||||
try values.encodeIfPresent(requiresLooping, forKey: "RequiresLooping")
|
||||
try values.encodeIfPresent(requiresOpening, forKey: "RequiresOpening")
|
||||
try values.encodeIfPresent(runTimeTicks, forKey: "RunTimeTicks")
|
||||
try values.encodeIfPresent(size, forKey: "Size")
|
||||
try values.encodeIfPresent(isSupportsDirectPlay, forKey: "SupportsDirectPlay")
|
||||
try values.encodeIfPresent(isSupportsDirectStream, forKey: "SupportsDirectStream")
|
||||
try values.encodeIfPresent(isSupportsProbing, forKey: "SupportsProbing")
|
||||
try values.encodeIfPresent(isSupportsTranscoding, forKey: "SupportsTranscoding")
|
||||
try values.encodeIfPresent(timestamp, forKey: "Timestamp")
|
||||
try values.encodeIfPresent(transcodingContainer, forKey: "TranscodingContainer")
|
||||
try values.encodeIfPresent(transcodingSubProtocol, forKey: "TranscodingSubProtocol")
|
||||
try values.encodeIfPresent(transcodingURL, forKey: "TranscodingUrl")
|
||||
try values.encodeIfPresent(type, forKey: "Type")
|
||||
try values.encodeIfPresent(video3DFormat, forKey: "Video3DFormat")
|
||||
try values.encodeIfPresent(videoType, forKey: "VideoType")
|
||||
}
|
||||
}
|
||||
|
@ -179,4 +179,128 @@ public struct MediaStream: Codable {
|
||||
self.videoRangeType = videoRangeType
|
||||
self.width = width
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.aspectRatio = try values.decodeIfPresent(String.self, forKey: "AspectRatio")
|
||||
self.averageFrameRate = try values.decodeIfPresent(Float.self, forKey: "AverageFrameRate")
|
||||
self.bitDepth = try values.decodeIfPresent(Int32.self, forKey: "BitDepth")
|
||||
self.bitRate = try values.decodeIfPresent(Int32.self, forKey: "BitRate")
|
||||
self.blPresentFlag = try values.decodeIfPresent(Int32.self, forKey: "BlPresentFlag")
|
||||
self.channelLayout = try values.decodeIfPresent(String.self, forKey: "ChannelLayout")
|
||||
self.channels = try values.decodeIfPresent(Int32.self, forKey: "Channels")
|
||||
self.codec = try values.decodeIfPresent(String.self, forKey: "Codec")
|
||||
self.codecTag = try values.decodeIfPresent(String.self, forKey: "CodecTag")
|
||||
self.codecTimeBase = try values.decodeIfPresent(String.self, forKey: "CodecTimeBase")
|
||||
self.colorPrimaries = try values.decodeIfPresent(String.self, forKey: "ColorPrimaries")
|
||||
self.colorRange = try values.decodeIfPresent(String.self, forKey: "ColorRange")
|
||||
self.colorSpace = try values.decodeIfPresent(String.self, forKey: "ColorSpace")
|
||||
self.colorTransfer = try values.decodeIfPresent(String.self, forKey: "ColorTransfer")
|
||||
self.comment = try values.decodeIfPresent(String.self, forKey: "Comment")
|
||||
self.deliveryMethod = try values.decodeIfPresent(SubtitleDeliveryMethod.self, forKey: "DeliveryMethod")
|
||||
self.deliveryURL = try values.decodeIfPresent(String.self, forKey: "DeliveryUrl")
|
||||
self.displayTitle = try values.decodeIfPresent(String.self, forKey: "DisplayTitle")
|
||||
self.dvBlSignalCompatibilityID = try values.decodeIfPresent(Int32.self, forKey: "DvBlSignalCompatibilityId")
|
||||
self.dvLevel = try values.decodeIfPresent(Int32.self, forKey: "DvLevel")
|
||||
self.dvProfile = try values.decodeIfPresent(Int32.self, forKey: "DvProfile")
|
||||
self.dvVersionMajor = try values.decodeIfPresent(Int32.self, forKey: "DvVersionMajor")
|
||||
self.dvVersionMinor = try values.decodeIfPresent(Int32.self, forKey: "DvVersionMinor")
|
||||
self.elPresentFlag = try values.decodeIfPresent(Int32.self, forKey: "ElPresentFlag")
|
||||
self.height = try values.decodeIfPresent(Int32.self, forKey: "Height")
|
||||
self.index = try values.decodeIfPresent(Int32.self, forKey: "Index")
|
||||
self.isAVC = try values.decodeIfPresent(Bool.self, forKey: "IsAVC")
|
||||
self.isAnamorphic = try values.decodeIfPresent(Bool.self, forKey: "IsAnamorphic")
|
||||
self.isDefault = try values.decodeIfPresent(Bool.self, forKey: "IsDefault")
|
||||
self.isExternal = try values.decodeIfPresent(Bool.self, forKey: "IsExternal")
|
||||
self.isExternalURL = try values.decodeIfPresent(Bool.self, forKey: "IsExternalUrl")
|
||||
self.isForced = try values.decodeIfPresent(Bool.self, forKey: "IsForced")
|
||||
self.isInterlaced = try values.decodeIfPresent(Bool.self, forKey: "IsInterlaced")
|
||||
self.isTextSubtitleStream = try values.decodeIfPresent(Bool.self, forKey: "IsTextSubtitleStream")
|
||||
self.language = try values.decodeIfPresent(String.self, forKey: "Language")
|
||||
self.level = try values.decodeIfPresent(Double.self, forKey: "Level")
|
||||
self.localizedDefault = try values.decodeIfPresent(String.self, forKey: "LocalizedDefault")
|
||||
self.localizedExternal = try values.decodeIfPresent(String.self, forKey: "LocalizedExternal")
|
||||
self.localizedForced = try values.decodeIfPresent(String.self, forKey: "LocalizedForced")
|
||||
self.localizedUndefined = try values.decodeIfPresent(String.self, forKey: "LocalizedUndefined")
|
||||
self.nalLengthSize = try values.decodeIfPresent(String.self, forKey: "NalLengthSize")
|
||||
self.packetLength = try values.decodeIfPresent(Int32.self, forKey: "PacketLength")
|
||||
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
|
||||
self.pixelFormat = try values.decodeIfPresent(String.self, forKey: "PixelFormat")
|
||||
self.profile = try values.decodeIfPresent(String.self, forKey: "Profile")
|
||||
self.realFrameRate = try values.decodeIfPresent(Float.self, forKey: "RealFrameRate")
|
||||
self.refFrames = try values.decodeIfPresent(Int32.self, forKey: "RefFrames")
|
||||
self.rpuPresentFlag = try values.decodeIfPresent(Int32.self, forKey: "RpuPresentFlag")
|
||||
self.sampleRate = try values.decodeIfPresent(Int32.self, forKey: "SampleRate")
|
||||
self.score = try values.decodeIfPresent(Int32.self, forKey: "Score")
|
||||
self.isSupportsExternalStream = try values.decodeIfPresent(Bool.self, forKey: "SupportsExternalStream")
|
||||
self.timeBase = try values.decodeIfPresent(String.self, forKey: "TimeBase")
|
||||
self.title = try values.decodeIfPresent(String.self, forKey: "Title")
|
||||
self.type = try values.decodeIfPresent(MediaStreamType.self, forKey: "Type")
|
||||
self.videoDoViTitle = try values.decodeIfPresent(String.self, forKey: "VideoDoViTitle")
|
||||
self.videoRange = try values.decodeIfPresent(String.self, forKey: "VideoRange")
|
||||
self.videoRangeType = try values.decodeIfPresent(String.self, forKey: "VideoRangeType")
|
||||
self.width = try values.decodeIfPresent(Int32.self, forKey: "Width")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(aspectRatio, forKey: "AspectRatio")
|
||||
try values.encodeIfPresent(averageFrameRate, forKey: "AverageFrameRate")
|
||||
try values.encodeIfPresent(bitDepth, forKey: "BitDepth")
|
||||
try values.encodeIfPresent(bitRate, forKey: "BitRate")
|
||||
try values.encodeIfPresent(blPresentFlag, forKey: "BlPresentFlag")
|
||||
try values.encodeIfPresent(channelLayout, forKey: "ChannelLayout")
|
||||
try values.encodeIfPresent(channels, forKey: "Channels")
|
||||
try values.encodeIfPresent(codec, forKey: "Codec")
|
||||
try values.encodeIfPresent(codecTag, forKey: "CodecTag")
|
||||
try values.encodeIfPresent(codecTimeBase, forKey: "CodecTimeBase")
|
||||
try values.encodeIfPresent(colorPrimaries, forKey: "ColorPrimaries")
|
||||
try values.encodeIfPresent(colorRange, forKey: "ColorRange")
|
||||
try values.encodeIfPresent(colorSpace, forKey: "ColorSpace")
|
||||
try values.encodeIfPresent(colorTransfer, forKey: "ColorTransfer")
|
||||
try values.encodeIfPresent(comment, forKey: "Comment")
|
||||
try values.encodeIfPresent(deliveryMethod, forKey: "DeliveryMethod")
|
||||
try values.encodeIfPresent(deliveryURL, forKey: "DeliveryUrl")
|
||||
try values.encodeIfPresent(displayTitle, forKey: "DisplayTitle")
|
||||
try values.encodeIfPresent(dvBlSignalCompatibilityID, forKey: "DvBlSignalCompatibilityId")
|
||||
try values.encodeIfPresent(dvLevel, forKey: "DvLevel")
|
||||
try values.encodeIfPresent(dvProfile, forKey: "DvProfile")
|
||||
try values.encodeIfPresent(dvVersionMajor, forKey: "DvVersionMajor")
|
||||
try values.encodeIfPresent(dvVersionMinor, forKey: "DvVersionMinor")
|
||||
try values.encodeIfPresent(elPresentFlag, forKey: "ElPresentFlag")
|
||||
try values.encodeIfPresent(height, forKey: "Height")
|
||||
try values.encodeIfPresent(index, forKey: "Index")
|
||||
try values.encodeIfPresent(isAVC, forKey: "IsAVC")
|
||||
try values.encodeIfPresent(isAnamorphic, forKey: "IsAnamorphic")
|
||||
try values.encodeIfPresent(isDefault, forKey: "IsDefault")
|
||||
try values.encodeIfPresent(isExternal, forKey: "IsExternal")
|
||||
try values.encodeIfPresent(isExternalURL, forKey: "IsExternalUrl")
|
||||
try values.encodeIfPresent(isForced, forKey: "IsForced")
|
||||
try values.encodeIfPresent(isInterlaced, forKey: "IsInterlaced")
|
||||
try values.encodeIfPresent(isTextSubtitleStream, forKey: "IsTextSubtitleStream")
|
||||
try values.encodeIfPresent(language, forKey: "Language")
|
||||
try values.encodeIfPresent(level, forKey: "Level")
|
||||
try values.encodeIfPresent(localizedDefault, forKey: "LocalizedDefault")
|
||||
try values.encodeIfPresent(localizedExternal, forKey: "LocalizedExternal")
|
||||
try values.encodeIfPresent(localizedForced, forKey: "LocalizedForced")
|
||||
try values.encodeIfPresent(localizedUndefined, forKey: "LocalizedUndefined")
|
||||
try values.encodeIfPresent(nalLengthSize, forKey: "NalLengthSize")
|
||||
try values.encodeIfPresent(packetLength, forKey: "PacketLength")
|
||||
try values.encodeIfPresent(path, forKey: "Path")
|
||||
try values.encodeIfPresent(pixelFormat, forKey: "PixelFormat")
|
||||
try values.encodeIfPresent(profile, forKey: "Profile")
|
||||
try values.encodeIfPresent(realFrameRate, forKey: "RealFrameRate")
|
||||
try values.encodeIfPresent(refFrames, forKey: "RefFrames")
|
||||
try values.encodeIfPresent(rpuPresentFlag, forKey: "RpuPresentFlag")
|
||||
try values.encodeIfPresent(sampleRate, forKey: "SampleRate")
|
||||
try values.encodeIfPresent(score, forKey: "Score")
|
||||
try values.encodeIfPresent(isSupportsExternalStream, forKey: "SupportsExternalStream")
|
||||
try values.encodeIfPresent(timeBase, forKey: "TimeBase")
|
||||
try values.encodeIfPresent(title, forKey: "Title")
|
||||
try values.encodeIfPresent(type, forKey: "Type")
|
||||
try values.encodeIfPresent(videoDoViTitle, forKey: "VideoDoViTitle")
|
||||
try values.encodeIfPresent(videoRange, forKey: "VideoRange")
|
||||
try values.encodeIfPresent(videoRangeType, forKey: "VideoRangeType")
|
||||
try values.encodeIfPresent(width, forKey: "Width")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,16 @@ public struct MediaURL: 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")
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,14 @@ public struct MediaUpdateInfoDto: Codable {
|
||||
public init(updates: [MediaUpdateInfoPathDto]? = nil) {
|
||||
self.updates = updates
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.updates = try values.decodeIfPresent([MediaUpdateInfoPathDto].self, forKey: "Updates")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(updates, forKey: "Updates")
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,16 @@ public struct MediaUpdateInfoPathDto: Codable {
|
||||
self.path = path
|
||||
self.updateType = updateType
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.path = try values.decodeIfPresent(String.self, forKey: "Path")
|
||||
self.updateType = try values.decodeIfPresent(String.self, forKey: "UpdateType")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(path, forKey: "Path")
|
||||
try values.encodeIfPresent(updateType, forKey: "UpdateType")
|
||||
}
|
||||
}
|
||||
|
@ -18,4 +18,18 @@ public struct MessageCommand: Codable {
|
||||
self.text = text
|
||||
self.timeoutMs = timeoutMs
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.header = try values.decodeIfPresent(String.self, forKey: "Header")
|
||||
self.text = try values.decode(String.self, forKey: "Text")
|
||||
self.timeoutMs = try values.decodeIfPresent(Int64.self, forKey: "TimeoutMs")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(header, forKey: "Header")
|
||||
try values.encode(text, forKey: "Text")
|
||||
try values.encodeIfPresent(timeoutMs, forKey: "TimeoutMs")
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,14 @@ public struct MetadataConfiguration: Codable {
|
||||
public init(useFileCreationTimeForDateAdded: Bool? = nil) {
|
||||
self.useFileCreationTimeForDateAdded = useFileCreationTimeForDateAdded
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.useFileCreationTimeForDateAdded = try values.decodeIfPresent(Bool.self, forKey: "UseFileCreationTimeForDateAdded")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(useFileCreationTimeForDateAdded, forKey: "UseFileCreationTimeForDateAdded")
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,24 @@ public struct MetadataEditorInfo: Codable {
|
||||
self.externalIDInfos = externalIDInfos
|
||||
self.parentalRatingOptions = parentalRatingOptions
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.contentType = try values.decodeIfPresent(String.self, forKey: "ContentType")
|
||||
self.contentTypeOptions = try values.decodeIfPresent([NameValuePair].self, forKey: "ContentTypeOptions")
|
||||
self.countries = try values.decodeIfPresent([CountryInfo].self, forKey: "Countries")
|
||||
self.cultures = try values.decodeIfPresent([CultureDto].self, forKey: "Cultures")
|
||||
self.externalIDInfos = try values.decodeIfPresent([ExternalIDInfo].self, forKey: "ExternalIdInfos")
|
||||
self.parentalRatingOptions = try values.decodeIfPresent([ParentalRating].self, forKey: "ParentalRatingOptions")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(contentType, forKey: "ContentType")
|
||||
try values.encodeIfPresent(contentTypeOptions, forKey: "ContentTypeOptions")
|
||||
try values.encodeIfPresent(countries, forKey: "Countries")
|
||||
try values.encodeIfPresent(cultures, forKey: "Cultures")
|
||||
try values.encodeIfPresent(externalIDInfos, forKey: "ExternalIdInfos")
|
||||
try values.encodeIfPresent(parentalRatingOptions, forKey: "ParentalRatingOptions")
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,26 @@ public struct MetadataOptions: Codable {
|
||||
self.localMetadataReaderOrder = localMetadataReaderOrder
|
||||
self.metadataFetcherOrder = metadataFetcherOrder
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.disabledImageFetchers = try values.decodeIfPresent([String].self, forKey: "DisabledImageFetchers")
|
||||
self.disabledMetadataFetchers = try values.decodeIfPresent([String].self, forKey: "DisabledMetadataFetchers")
|
||||
self.disabledMetadataSavers = try values.decodeIfPresent([String].self, forKey: "DisabledMetadataSavers")
|
||||
self.imageFetcherOrder = try values.decodeIfPresent([String].self, forKey: "ImageFetcherOrder")
|
||||
self.itemType = try values.decodeIfPresent(String.self, forKey: "ItemType")
|
||||
self.localMetadataReaderOrder = try values.decodeIfPresent([String].self, forKey: "LocalMetadataReaderOrder")
|
||||
self.metadataFetcherOrder = try values.decodeIfPresent([String].self, forKey: "MetadataFetcherOrder")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(disabledImageFetchers, forKey: "DisabledImageFetchers")
|
||||
try values.encodeIfPresent(disabledMetadataFetchers, forKey: "DisabledMetadataFetchers")
|
||||
try values.encodeIfPresent(disabledMetadataSavers, forKey: "DisabledMetadataSavers")
|
||||
try values.encodeIfPresent(imageFetcherOrder, forKey: "ImageFetcherOrder")
|
||||
try values.encodeIfPresent(itemType, forKey: "ItemType")
|
||||
try values.encodeIfPresent(localMetadataReaderOrder, forKey: "LocalMetadataReaderOrder")
|
||||
try values.encodeIfPresent(metadataFetcherOrder, forKey: "MetadataFetcherOrder")
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,16 @@ public struct MovePlaylistItemRequestDto: Codable {
|
||||
self.newIndex = newIndex
|
||||
self.playlistItemID = playlistItemID
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: StringCodingKey.self)
|
||||
self.newIndex = try values.decodeIfPresent(Int32.self, forKey: "NewIndex")
|
||||
self.playlistItemID = try values.decodeIfPresent(UUID.self, forKey: "PlaylistItemId")
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: StringCodingKey.self)
|
||||
try values.encodeIfPresent(newIndex, forKey: "NewIndex")
|
||||
try values.encodeIfPresent(playlistItemID, forKey: "PlaylistItemId")
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user