Class: TheTvDbParty::BaseEpisodeRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/thetvdb_party/baseepisoderecord.rb

Overview

The Base Episode Record contains all of the information available about an episode.

Remarks

The fields #airsafter_season, #airsbefore_episode, and #airsbefore_season will only be included when the episode is listed as a special. Specials are also listed as being in season 0, so they're easy to identify and sort.

#dvd_episodenumber is a decimal and can be used to join episodes together. Usually used to join episodes that aired as two episodes but were released on DVD as a single episode. Normally there would be no decimal value but if you see an episode 1.1 and 1.2 that means both records should be combined to make episode 1. Cartoons are also known to combine up to 9 episodes together, for example Animaniacs season two.

See Also

thetvdb.com/wiki/index.php?title=API:Base_Episode_Record

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, hashValues) ⇒ BaseEpisodeRecord

Initializes a new Base Episode Record as it was retrieved from a given client.

Parameters
client

The TheTvDbParty::Client instance that retrieved the record.

hashValues

A Hash=> String instance that maps the record element names to their string values.


126
127
128
129
130
131
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 126

def initialize(client, hashValues)
  @client = client
  @hashValues = hashValues

  read_hash_values
end

Instance Attribute Details

#absolute_numberObject (readonly)

An unsigned integer. Negative, if invalid.

Remarks

Indicates the absolute episode number and completely ignores seasons. In others words a series with 20 episodes per season will have Season 3 episode 10 listed as 50. The field is mostly used with cartoons and anime series as they may have ambiguous seasons making it easier to use this field.


90
91
92
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 90

def absolute_number
  @absolute_number
end

#airsafter_seasonObject (readonly)

An unsigned integer indicating the season number this episode comes after. This field is only available for special episodes. Negative, if unavailable.


93
94
95
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 93

def airsafter_season
  @airsafter_season
end

#airsbefore_episodeObject (readonly)

An unsigned integer indicating the episode number this special episode airs before. Must be used in conjunction with #airsbefore_season, and not with #airsafter_season. This field is only available for special episodes. Negative, if unavailable.


98
99
100
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 98

def airsbefore_episode
  @airsbefore_episode
end

#airsbefore_seasonObject (readonly)

An unsigned integer indicating the season number this special episode airs before. Should be used in conjunction with #airsbefore_episode for exact placement. This field is only available for special episodes. Negative, if unavailable.


103
104
105
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 103

def airsbefore_season
  @airsbefore_season
end

#clientObject (readonly)

Returns the value of attribute client


15
16
17
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 15

def client
  @client
end

#combined_episodenumberObject (readonly)

A decimal. Negative, if invalid. This returns the value of #dvd_episodenumber if that field is not null. Otherwise it returns the value from #episodenumber.

Remarks

The field can be used as a simple way of prioritizing DVD order over aired order in your program. In general it's best to avoid using this field as you can accomplish the same task locally and have more control if you use the #dvd_episodenumber and #episodenumber fields separately.


23
24
25
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 23

def combined_episodenumber
  @combined_episodenumber
end

#combined_seasonObject (readonly)

A decimal. Negative, if invalid. This returns the value of #dvd_season if that field is not null. Otherwise it returns the value from #seasonnumber.

Remarks

The field can be used as a simple way of prioritizing DVD order over aired order in your program. In general it's best to avoid using this field as you can accomplish the same task locally and have more control if you use the #dvd_season and #seasonnumber fields separately.


29
30
31
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 29

def combined_season
  @combined_season
end

#directorObject (readonly)

An array of directors in plain text. Empty, if none are listed.


47
48
49
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 47

def director
  @director
end

#dvd_chapterObject (readonly)

Deprecated, was meant to be used to aid in scrapping of actual DVD's but has never been populated properly. Any information returned in this field shouldn't be trusted. Will usually be null.


32
33
34
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 32

def dvd_chapter
  @dvd_chapter
end

#dvd_discidObject (readonly)

Deprecated, was meant to be used to aid in scrapping of actual DVD's but has never been populated properly. Any information returned in this field shouldn't be trusted. Will usually be null.


35
36
37
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 35

def dvd_discid
  @dvd_discid
end

#dvd_episodenumberObject (readonly)

A decimal with one decimal and can be used to join episodes together. Negative if invalid, usually used to join episodes that aired as two episodes but were released on DVD as a single episode. If you see an episode 1.1 and 1.2 that means both records should be combined to make episode 1. Cartoons are also known to combine up to 9 episodes together, for example Animaniacs season two.


41
42
43
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 41

def dvd_episodenumber
  @dvd_episodenumber
end

#dvd_seasonObject (readonly)

An unsigned integer indicating the season the episode was in according to the DVD release. Usually is the same as #seasonnumber but can be different. Negative, if invalid


45
46
47
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 45

def dvd_season
  @dvd_season
end

#epimgflagObject (readonly)

An unsigned integer, 0 (zero) if no image is associated with the episode.

Values
1

4:3 - Indicates an image is a proper 4:3 (1.31 to 1.35) aspect ratio.

2

16:9 - Indicates an image is a proper 16:9 (1.739 to 1.818) aspect ratio.

3

Invalid Aspect Ratio - Indicates anything not in a 4:3 or 16:9 ratio. We don't bother listing any other non standard ratios.

4

Image too Small - Just means the image is smaller than 300x170.

5

Black Bars - Indicates there are black bars along one or all four sides of the image.

6

Improper Action Shot - Could mean a number of things, usually used when someone uploads a promotional picture that isn't actually from that episode but does refrence the episode, it could also mean it's a credit shot or that there is writting all over it. It's rarely used since most times an image would just be outright deleted if it falls in this category.

Remarks

If it's 1 or 2 TheTvDb assumes it's a proper image, anything above 2 is considered incorrect and can be replaced by anyone with an account.


60
61
62
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 60

def epimgflag
  @epimgflag
end

#episodenameObject (readonly)

A string containing the episode name in the language requested. Will return the English name if no translation is available in the language requested.


62
63
64
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 62

def episodename
  @episodename
end

#episodenumberObject (readonly)

An unsigned integer representing the episode number in its season according to the aired order. Negative, if invalid.


64
65
66
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 64

def episodenumber
  @episodenumber
end

#firstairedObject (readonly)

The date the series first aired. nil if not known.


66
67
68
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 66

def firstaired
  @firstaired
end

#gueststarsObject (readonly)

An array of the guest stars in that episode. Empty, if none are listed.


68
69
70
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 68

def gueststars
  @gueststars
end

#idObject (readonly)

An unsigned integer assigned by TheTvDb to the episode. Negative, if invalid.


17
18
19
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 17

def id
  @id
end

#imagepath_fullObject (readonly)

Returns the full URI of the episode image. nil if unavailable.


107
108
109
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 107

def imagepath_full
  @imagepath_full
end

#imagepath_relativeObject (readonly)

Returns the relative path of the episode image. nil if unavailable.


105
106
107
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 105

def imagepath_relative
  @imagepath_relative
end

#imdb_idObject (readonly)

An alphanumeric string containing the IMDB ID for the series. Can be null.


70
71
72
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 70

def imdb_id
  @imdb_id
end

#languageObject (readonly)

A two character string indicating the language in accordance with ISO-639-1. Cannot be null.


72
73
74
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 72

def language
  @language
end

#lastupdatedObject (readonly)

The last time any changes were made to the episode record. nil, if unavailable.


109
110
111
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 109

def lastupdated
  @lastupdated
end

#overviewObject (readonly)

A string containing the overview in the language requested. Will return the English overview if no translation is available in the language requested. Can be null.


74
75
76
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 74

def overview
  @overview
end

#productioncodeObject (readonly)

An alphanumeric string. Can be null.


76
77
78
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 76

def productioncode
  @productioncode
end

#ratingObject (readonly)

The average rating users have rated the series out of 10, rounded to 1 decimal place.


78
79
80
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 78

def rating
  @rating
end

#ratingcountObject (readonly)

An unsigned integer representing the number of users who have rated the series.


80
81
82
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 80

def ratingcount
  @ratingcount
end

#seasonidObject (readonly)

An unsigned integer assigned by TheTvDb to the season. Negative, if invalid.


111
112
113
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 111

def seasonid
  @seasonid
end

#seasonnumberObject (readonly)

An unsigned integer representing the season number for the episode according to the aired order. Negative, if invalid.


82
83
84
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 82

def seasonnumber
  @seasonnumber
end

#seriesidObject (readonly)

An unsigned integer assigned by TheTvDb to the series. It does not change and will always represent the same series. Negative, if invalid.


114
115
116
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 114

def seriesid
  @seriesid
end

#thumb_addedObject (readonly)

The date and time the episode image was added to the TheTvDb site. nil, if unavailable.


116
117
118
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 116

def thumb_added
  @thumb_added
end

#thumb_heightObject (readonly)

An unsigned integer that represents the height of the episode image in pixels. 0, if not specified.


118
119
120
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 118

def thumb_height
  @thumb_height
end

#thumb_widthObject (readonly)

An unsigned integer that represents the width of the episode image in pixels. 0, if not specified.


120
121
122
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 120

def thumb_width
  @thumb_width
end

#writerObject (readonly)

An array of the writers of the episode. Empty, if none are listed.


84
85
86
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 84

def writer
  @writer
end

Instance Method Details

#get_base_series_recordObject

Retrieves the Base Series Record for the series this episode belongs to.

Returns

A TheTvDbParty::BaseSeriesRecord instance that represents the series, or nil if the series record could not be retrieved.

See Also

TheTvDbParty::Client#get_base_series_record


136
137
138
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 136

def get_base_series_record
  @client.get_base_series_record @seriesid
end