Skip to content

TVEpisodes

George Kye edited this page Oct 26, 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, episodes in
      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: 1396, seasonNumber: 1, episodeNumber: 1){
      apiReturn, castCrew in
      if let castCrew = castCrew{
        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 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, externalIds in
      if let ids = externalIds {
        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, images in
      if let images = images{
        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, videos in
      if let videos = videos{
        for vid in videos {
          print(vid.site)
          print(vid.name)
          print(vid.type)
        }
      }
    }
``
Clone this wiki locally