Skip to content

TVSeasons **FIX ME**

George Kye edited this page Oct 26, 2016 · 2 revisions

Get the primary information about a TV season by id and its season number

         TVSeasonsMDB.season_number(apikey, tvShowId: 1398, seasonNumber: 1, language: "EN"){
      apiReturn, tvSeason in
      if let season = tvSeason{
        print(season.name)
        print(season.overview)
        print(season.episodes[0].name)
      }
    }

Get the cast and crew credits for a TV show by id and its season number.

      TVSeasonsMDB.credits(apikey, tvShowId: 1396, seasonNumber: 1, language: "en"){
            apiReturn in
            let castCrew = apiReturn.MBDBReturn as! TVCreditsMDB
            for crew in castCrew.crew{
                print(crew.job)
                print(crew.name)
                print(crew.department)
            }
            for cast in castCrew.cast{
                print(cast.character)
                print(cast.name)
                print(cast.order)
            }
        }
        

Get the images (posters) that we have stored for a TV season by id and season number.

   
        //backdrops will be `nil`
        TVSeasonsMDB.images(apikey, tvShowId: 60735, seasonNumber: 1, language: "EN"){
            apiReturn in
            let images = apiReturn.MBDBReturn as! ImagesMDB
            print(images.posters[0].iso_639_1)
            print(images.posters[0].width)
            print(images.posters[0].file_path)
            
        }

Get the videos that have been added to a TV season (trailers, teasers, etc...)

            TVSeasonsMDB.videos(apikey, tvShowId: 60735, seasonNumber: 1, language: "EN"){
            apiReturn in
            let videos = apiReturn.MBDBReturn as! [VideosMDB]
            for vid in videos {
                print(vid.site)
                print(vid.name)
            }
        }

Get the external ids that we have stored for a TV season by season number.

   TVSeasonsMDB.externalIDS(apikey, tvShowId: 1396, seasonNumber: 1, language: "en"){
            apiReturn in
            let ids = apiReturn.MBDBReturn as! ExternalIdsMDB
            print(ids.tvdb_id)
            print(ids.freebase_mid)
            print(ids.freebase_id)
        }

*Add alternative_titles method

Clone this wiki locally