Improve MediaKind usage.

This commit is contained in:
Damiano Galassi committed 2020-02-04 17:54:08 +01:00
1 parent 2ad39bfed6
commit 2694bdee45
9 files changed
+185 -191

No files matched your search

+16 -17
View File
@@ -68,6 +68,20 @@ public struct Artwork {
public let size: ArtworkSize
}
public enum MediaKind: Int {
case tvShow = 10
case movie = 9
public var description: String {
switch self {
case .movie:
return "Movie"
case .tvShow:
return "TV"
}
}
}
private let localizedKeys: [MetadataResult.Key: String] = [
.name : NSLocalizedString("Name", comment: "nil"),
.composer : NSLocalizedString("Composer", comment: "nil"),
@@ -103,7 +117,7 @@ private let localizedKeys: [MetadataResult.Key: String] = [
.serviceEpisodeID : NSLocalizedString("Service ID", comment: "nil")
]
public class MetadataResult {
public final class MetadataResult {
public enum Key: String {
// Common Keys
@@ -263,22 +277,7 @@ public class MetadataResult {
}
private var dictionary: [Key:Any]
public enum MediaKindType: Int {
case tvShow = 10
case movie = 9
public var description: String {
switch self {
case .movie:
return "Movie"
case .tvShow:
return "TV"
}
}
}
public var mediaKind: MediaKindType
public var mediaKind: MediaKind
public var contentRating: Int
public var remoteArtworks: [Artwork]
public var artworks: [MP42Image]