Skip to content

Commit

Permalink
Merge pull request #15 from LePips/main
Browse files Browse the repository at this point in the history
  • Loading branch information
LePips authored Dec 7, 2022
2 parents 40fca84 + 16fff60 commit 87a77bb
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 117 deletions.
2 changes: 1 addition & 1 deletion Sources/Entities/BaseItemDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public struct BaseItemDto: Codable, Identifiable {
public var timerID: String?
/// Gets or sets the trailer count.
public var trailerCount: Int32?
/// Gets or sets the type.
/// The base item kind.
public var type: BaseItemKind?
/// Gets or sets the user data for this item based on the user it's being requested for.
public var userData: UserItemDataDto?
Expand Down
12 changes: 1 addition & 11 deletions Sources/Entities/ClientCapabilitiesDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@ import Foundation
public struct ClientCapabilitiesDto: Codable {
/// Gets or sets the app store url.
public var appStoreURL: String?
/// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.
///
/// <br />
///
/// Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and
///
/// <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)
///
/// the device is able to direct play (without transcoding or remuxing),
///
/// as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't.
/// Gets or sets the device profile.
public var deviceProfile: DeviceProfile?
/// Gets or sets the icon url.
public var iconURL: String?
Expand Down
4 changes: 2 additions & 2 deletions Sources/Entities/DisplayPreferencesDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ public struct DisplayPreferencesDto: Codable, Identifiable {
public var isRememberIndexing: Bool?
/// Gets or sets a value indicating whether [remember sorting].
public var isRememberSorting: Bool?
/// Gets or sets the scroll direction.
/// An enum representing the axis that should be scrolled.
public var scrollDirection: ScrollDirection?
/// Gets or sets a value indicating whether to show backdrops on this item.
public var isShowBackdrop: Bool?
/// Gets or sets a value indicating whether [show sidebar].
public var isShowSidebar: Bool?
/// Gets or sets the sort by.
public var sortBy: String?
/// Gets or sets the sort order.
/// An enum representing the sorting order.
public var sortOrder: SortOrder?
/// Gets or sets the type of the view.
public var viewType: String?
Expand Down
1 change: 1 addition & 0 deletions Sources/Entities/MediaStreamType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public enum MediaStreamType: String, Codable, CaseIterable {
case video = "Video"
case subtitle = "Subtitle"
case embeddedImage = "EmbeddedImage"
case data = "Data"
}
12 changes: 1 addition & 11 deletions Sources/Entities/OpenLiveStreamDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@ import Foundation
public struct OpenLiveStreamDto: Codable {
/// Gets or sets the audio stream index.
public var audioStreamIndex: Int32?
/// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.
///
/// <br />
///
/// Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and
///
/// <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)
///
/// the device is able to direct play (without transcoding or remuxing),
///
/// as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't.
/// Gets or sets the device profile.
public var deviceProfile: DeviceProfile?
/// Gets or sets the device play protocols.
public var directPlayProtocols: [MediaProtocol]?
Expand Down
12 changes: 1 addition & 11 deletions Sources/Entities/PlaybackInfoDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,7 @@ public struct PlaybackInfoDto: Codable {
public var audioStreamIndex: Int32?
/// Gets or sets a value indicating whether to auto open the live stream.
public var isAutoOpenLiveStream: Bool?
/// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.
///
/// <br />
///
/// Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and
///
/// <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)
///
/// the device is able to direct play (without transcoding or remuxing),
///
/// as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't.
/// Gets or sets the device profile.
public var deviceProfile: DeviceProfile?
/// Gets or sets a value indicating whether to enable direct play.
public var enableDirectPlay: Bool?
Expand Down
2 changes: 1 addition & 1 deletion Sources/Entities/QueueRequestDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
public struct QueueRequestDto: Codable {
/// Gets or sets the items to enqueue.
public var itemIDs: [String]?
/// Enum GroupQueueMode.
/// Gets or sets the mode in which to add the new items.
public var mode: GroupQueueMode?

public init(itemIDs: [String]? = nil, mode: GroupQueueMode? = nil) {
Expand Down
4 changes: 1 addition & 3 deletions Sources/Entities/SessionInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public struct SessionInfo: Codable, Identifiable {
public var lastActivityDate: Date?
/// Gets or sets the last playback check in.
public var lastPlaybackCheckIn: Date?
/// This is strictly used as a data transfer object from the api layer.
///
/// This holds information about a BaseItem in a format that is convenient for the client.
/// Gets or sets the now playing item.
public var nowPlayingItem: BaseItemDto?
public var nowPlayingQueue: [QueueItem]?
public var nowPlayingQueueFullItems: [BaseItemDto]?
Expand Down
2 changes: 1 addition & 1 deletion Sources/Entities/SetRepeatModeRequestDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

/// Class SetRepeatModeRequestDto.
public struct SetRepeatModeRequestDto: Codable {
/// Enum GroupRepeatMode.
/// Gets or sets the repeat mode.
public var mode: GroupRepeatMode?

public init(mode: GroupRepeatMode? = nil) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Entities/SetShuffleModeRequestDto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

/// Class SetShuffleModeRequestDto.
public struct SetShuffleModeRequestDto: Codable {
/// Enum GroupShuffleMode.
/// Gets or sets the shuffle mode.
public var mode: GroupShuffleMode?

public init(mode: GroupShuffleMode? = nil) {
Expand Down
37 changes: 37 additions & 0 deletions Sources/Entities/TranscodeReason.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2022 Jellyfin & Jellyfin Contributors
//

import Foundation

public enum TranscodeReason: String, Codable, CaseIterable {
case containerNotSupported = "ContainerNotSupported"
case videoCodecNotSupported = "VideoCodecNotSupported"
case audioCodecNotSupported = "AudioCodecNotSupported"
case subtitleCodecNotSupported = "SubtitleCodecNotSupported"
case audioIsExternal = "AudioIsExternal"
case secondaryAudioNotSupported = "SecondaryAudioNotSupported"
case videoProfileNotSupported = "VideoProfileNotSupported"
case videoLevelNotSupported = "VideoLevelNotSupported"
case videoResolutionNotSupported = "VideoResolutionNotSupported"
case videoBitDepthNotSupported = "VideoBitDepthNotSupported"
case videoFramerateNotSupported = "VideoFramerateNotSupported"
case refFramesNotSupported = "RefFramesNotSupported"
case anamorphicVideoNotSupported = "AnamorphicVideoNotSupported"
case interlacedVideoNotSupported = "InterlacedVideoNotSupported"
case audioChannelsNotSupported = "AudioChannelsNotSupported"
case audioProfileNotSupported = "AudioProfileNotSupported"
case audioSampleRateNotSupported = "AudioSampleRateNotSupported"
case audioBitDepthNotSupported = "AudioBitDepthNotSupported"
case containerBitrateExceedsLimit = "ContainerBitrateExceedsLimit"
case videoBitrateNotSupported = "VideoBitrateNotSupported"
case audioBitrateNotSupported = "AudioBitrateNotSupported"
case unknownVideoStreamInfo = "UnknownVideoStreamInfo"
case unknownAudioStreamInfo = "UnknownAudioStreamInfo"
case directPlayError = "DirectPlayError"
case videoRangeTypeNotSupported = "VideoRangeTypeNotSupported"
}
34 changes: 3 additions & 31 deletions Sources/Entities/TranscodingInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,10 @@ public struct TranscodingInfo: Codable {
public var height: Int32?
public var isAudioDirect: Bool?
public var isVideoDirect: Bool?
public var transcodeReasons: TranscodeReasons?
public var transcodeReasons: [TranscodeReason]?
public var videoCodec: String?
public var width: Int32?

public enum TranscodeReasons: String, Codable, CaseIterable {
case containerNotSupported = "ContainerNotSupported"
case videoCodecNotSupported = "VideoCodecNotSupported"
case audioCodecNotSupported = "AudioCodecNotSupported"
case subtitleCodecNotSupported = "SubtitleCodecNotSupported"
case audioIsExternal = "AudioIsExternal"
case secondaryAudioNotSupported = "SecondaryAudioNotSupported"
case videoProfileNotSupported = "VideoProfileNotSupported"
case videoLevelNotSupported = "VideoLevelNotSupported"
case videoResolutionNotSupported = "VideoResolutionNotSupported"
case videoBitDepthNotSupported = "VideoBitDepthNotSupported"
case videoFramerateNotSupported = "VideoFramerateNotSupported"
case refFramesNotSupported = "RefFramesNotSupported"
case anamorphicVideoNotSupported = "AnamorphicVideoNotSupported"
case interlacedVideoNotSupported = "InterlacedVideoNotSupported"
case audioChannelsNotSupported = "AudioChannelsNotSupported"
case audioProfileNotSupported = "AudioProfileNotSupported"
case audioSampleRateNotSupported = "AudioSampleRateNotSupported"
case audioBitDepthNotSupported = "AudioBitDepthNotSupported"
case containerBitrateExceedsLimit = "ContainerBitrateExceedsLimit"
case videoBitrateNotSupported = "VideoBitrateNotSupported"
case audioBitrateNotSupported = "AudioBitrateNotSupported"
case unknownVideoStreamInfo = "UnknownVideoStreamInfo"
case unknownAudioStreamInfo = "UnknownAudioStreamInfo"
case directPlayError = "DirectPlayError"
case videoRangeTypeNotSupported = "VideoRangeTypeNotSupported"
}

public init(
audioChannels: Int32? = nil,
audioCodec: String? = nil,
Expand All @@ -62,7 +34,7 @@ public struct TranscodingInfo: Codable {
height: Int32? = nil,
isAudioDirect: Bool? = nil,
isVideoDirect: Bool? = nil,
transcodeReasons: TranscodeReasons? = nil,
transcodeReasons: [TranscodeReason]? = nil,
videoCodec: String? = nil,
width: Int32? = nil
) {
Expand Down Expand Up @@ -93,7 +65,7 @@ public struct TranscodingInfo: Codable {
self.height = try values.decodeIfPresent(Int32.self, forKey: "Height")
self.isAudioDirect = try values.decodeIfPresent(Bool.self, forKey: "IsAudioDirect")
self.isVideoDirect = try values.decodeIfPresent(Bool.self, forKey: "IsVideoDirect")
self.transcodeReasons = try values.decodeIfPresent(TranscodeReasons.self, forKey: "TranscodeReasons")
self.transcodeReasons = try values.decodeIfPresent([TranscodeReason].self, forKey: "TranscodeReasons")
self.videoCodec = try values.decodeIfPresent(String.self, forKey: "VideoCodec")
self.width = try values.decodeIfPresent(Int32.self, forKey: "Width")
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Entities/UserPolicy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public struct UserPolicy: Codable {
public var maxParentalRating: Int32?
public var passwordResetProviderID: String?
public var remoteClientBitrateLimit: Int32?
/// Gets or sets a value indicating what SyncPlay features the user can access.
/// Enum SyncPlayUserAccessType.
public var syncPlayAccess: SyncPlayUserAccessType?

public init(
Expand Down
Loading

0 comments on commit 87a77bb

Please sign in to comment.