-
-
Save Pasanpr/97f9d086588969b6c067f00c75f9929e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ItunesEntity: QueryItemProvider { | |
var entityName: String { get } | |
} | |
extension ItunesEntity { | |
var queryItem: URLQueryItem { | |
return URLQueryItem(name: "entity", value: entityName) | |
} | |
} | |
enum MovieEntity: String, ItunesEntity { | |
case movieArtist | |
case movie | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum PodcastEntity: String, ItunesEntity { | |
case podcastAuthor | |
case podcast | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum MusicEntity: String, ItunesEntity { | |
case musicArtist | |
case musicTrack | |
case album | |
case musicVideo | |
case mix | |
case song | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum MusicVideoEntity: String, ItunesEntity { | |
case musicArtist | |
case musicVideo | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum AudiobookEntity: String, ItunesEntity { | |
case audiobookAuthor | |
case audiobook | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum ShortFilmEntity: String, ItunesEntity { | |
case shortFilmArtist | |
case shortFilm | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum TVShowEntity: String, ItunesEntity { | |
case tvEpisode | |
case tvSeason | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum SoftwareEntity: String, ItunesEntity { | |
case software | |
case iPadSoftware | |
case macSoftware | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum EbookEntity: String, ItunesEntity { | |
case ebook | |
var entityName: String { | |
return self.rawValue | |
} | |
} | |
enum AllEntity: String, ItunesEntity { | |
case movie | |
case album | |
case allArtist | |
case podcast | |
case musicVideo | |
case mix | |
case audiobook | |
case tvSeason | |
case allTrack | |
var entityName: String { | |
return self.rawValue | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment