Skip to content

Instantly share code, notes, and snippets.

@Pasanpr
Created April 5, 2017 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pasanpr/97f9d086588969b6c067f00c75f9929e to your computer and use it in GitHub Desktop.
Save Pasanpr/97f9d086588969b6c067f00c75f9929e to your computer and use it in GitHub Desktop.
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