Skip to content

TVEpisodes

George Kye edited this page Mar 8, 2016 · 6 revisions

Get the primary information about a TV episode by combination of a season and episode number.

    TVEpisodesMDB.episode_number(apikey, tvShowId: 60735, seasonNumber: 1, episodeNumber: 3, language: nil){
            apiReturn in
            let episodes = TVEpisodesMDB.init(results: apiReturn.json!)
            print(episodes.overview)
            print(episodes.guest_stars[0].character)
            print(episodes.guest_stars[0].name)
            print(episodes.crew[0].name)
        }

Get the TV episode credits by combination of season and episode number.

       TVEpisodesMDB.credits(apikey, tvShowId: 60735, seasonNumber: 1, episodeNumber: 3){
            apiReturn in
            let credits = apiReturn.MBDBReturn as! CastCrewMDB
            print(credits.crew.count)
            for i in credits.cast {
                print(i.credit_id)
            }
            for i1 in credits.crew {
                print(i1.job)
            }
        }

Get the external ids for a TV episode by comabination of a season and episode number.

     TVEpisodesMDB.externalIDS(apikey, tvShowId: 60735, seasonNumber: 1, episodeNumber: 1, language: "en"){
            apiReturn in
            let ids = apiReturn.MBDBReturn as! ExternalIdsMDB
            print(ids.imdb_id)
            print(ids.tvdb_id) //**might return nil
            print(ids.freebase_mid)
            print(ids.freebase_id)
            print(ids.tvrage_id)
        }

Get the images (episode stills) for a TV episode by combination of a season and episode number. Since episode stills don't have a language, this call will always return all images.

 TVEpisodesMDB.images(apikey, tvShowId: 60735, seasonNumber: 1, episodeNumber: 1){
            apiReturn in
            let images = apiReturn.MBDBReturn as! ImagesMDB
            print(images.stills[0].iso_639_1)
            print(images.stills[0].width)
            print(images.stills[0].file_path)
            //TV show have no posters or backdrops (stills only)
        }

Get the primary information about a TV episode by combination of a season and episode number.

    TVEpisodesMDB.videos(apikey, tvShowId: 1399, seasonNumber: 5, episodeNumber: 1, language: nil){
            apiReturn in
            let videos = apiReturn.MBDBReturn as! [VideosMDB]
            for vid in videos {
                print(vid.site)
                print(vid.name)
                print(vid.type)
            }
        }
``
Clone this wiki locally