-
Notifications
You must be signed in to change notification settings - Fork 38
DiscoverMovie
George Kye edited this page Oct 26, 2016
·
5 revisions
DiscoverMovie ->returns [MovieMDB]
Basic discover movie query
DiscoverMovieMDB.discoverMovies(apikey: apikey, language: "EN", page: 1, sort_by: DiscoverSortByMovie.popularity_desc){ data, movieArr in
if let movieArr = movieArr{
print(movieArr[0].title)
print(movieArr[0].original_title)
print(movieArr[0].release_date)
print(movieArr[0].overview)
}
}
Discover movies with genres action OR war. (| (pipe)
used to indicate an OR
query ,
used for an AND
query) with Brad Pitt;
DiscoverMovieMDB.discoverMoviesWith(apikey, with_genres: "\(MovieGenres.Action.rawValue),\(MovieGenres.War.rawValue)", with_cast: nil, with_crew: nil, with_companies: nil, with_keywords: nil,with_people: "287", with_networks: nil, year: nil, sort_by: DiscoverSortByMovie.popularity_desc, page: 1, language: "EN"){
data, movieArr in
if let movieArr = movieArr{
print(movieArr[0].title)
print(movieArr[0].original_title)
print(movieArr[0].release_date)
print(movieArr[0].overview)
}
}
Discover movies with genres Horror OR War with vote average greater than 8 and vote count greater than 2
DiscoverMovieMDB.discoverMovies(apikey: apikey, language:"EN", page: 1, vote_average_gte: 8.0, vote_average_lte: 8, vote_count_gte: 2, with_genres: MovieGenres.Horror.rawValue + "|" + MovieGenres.War.rawValue){
data, movieArr in
if let movieArr = movieArr{
print(movieArr[0].title)
print(movieArr[0].original_title)
print(movieArr[0].release_date)
print(movieArr[0].overview)
}
}
Discover movies with release dates between 2015-01-01 AND 2015-01-05
DiscoverMovieMDB.discoverMovies(apikey: apikey, language: "EN", page: 1, primary_release_date_gte: "2015-01-01", primary_release_date_lte: "2015-01-05"){
data, movieArr in
if let movieArr = movieArr{
print(movieArr[0].title)
print(movieArr[0].original_title)
print(movieArr[0].release_date)
print(movieArr[0].overview)
}
}