class TvdbPartyV2::Series

Attributes

actors[RW]
air_time[RW]
airs_dayofweek[RW]
banners[RW]
client[R]
first_aired[RW]
genres[RW]
id[RW]
imdb_id[RW]
name[RW]
network[RW]
overview[RW]
rating[RW]
ratingcount[RW]
runtime[RW]
seasons[RW]
status[RW]

Public Class Methods

new(client, options = {}) click to toggle source
# File lib/tvdb_party_v2/series.rb, line 8
def initialize(client, options = {})
  @client = client
  @id = options["id"]
  @name = options["seriesName"]
  @overview = options["overview"]
  @network = options["network"]
  @runtime = options["runtime"]
  @air_time = options['airsTime'] if options['airsTime']
  @imdb_id = options["imdbId"]
  @status = options["status"] if options["status"]
  @airs_dayofweek = options["airsDayOfWeek"]

  if options["genre"]
    @genres = options["genre"]
  else
    @genres = []
  end

  if options["siteRating"] && options["siteRating"] > 0
    @rating = options["siteRating"].to_f
  else
    @rating = 0
  end

  if options["siteRatingCount"] && options["siteRatingCount"] > 0
    @ratingcount = options["siteRatingCount"].to_f
  else
    @ratingcount = 0
  end

  begin
    @first_aired = Time.parse(options["firstAired"]).to_i
  rescue
    @first_aired = 0
  end
end

Public Instance Methods

episode(season_number, episode_number) click to toggle source
# File lib/tvdb_party_v2/series.rb, line 45
def episode(season_number, episode_number)
  client.get_episode(self, season_number, episode_number)
end
fanart() click to toggle source
# File lib/tvdb_party_v2/series.rb, line 53
def fanart
  client.get_banners(self, 'fanart')
end
posters() click to toggle source
# File lib/tvdb_party_v2/series.rb, line 49
def posters
  client.get_banners(self, 'poster')
end
season(season_number) click to toggle source
# File lib/tvdb_party_v2/series.rb, line 87
def season(season_number)
  client.get_episode(self, season_number)
end
season_banners() click to toggle source
# File lib/tvdb_party_v2/series.rb, line 61
def season_banners
  client.get_banners(self, 'season')
end
season_posters(season_number) click to toggle source
# File lib/tvdb_party_v2/series.rb, line 69
def season_posters(season_number)
  season_banners.select {|b| b.subkey == season_number.to_s}
end
seasonwide() click to toggle source
# File lib/tvdb_party_v2/series.rb, line 65
def seasonwide
  client.get_banners(self, 'seasonwide')
end
seasonwide_posters(season_number) click to toggle source
# File lib/tvdb_party_v2/series.rb, line 73
def seasonwide_posters(season_number)
  seasonwide.select {|b| b.subkey == season_number.to_s}
end
series_banners() click to toggle source
# File lib/tvdb_party_v2/series.rb, line 57
def series_banners
  client.get_banners(self, 'series')
end