Class: TheTvDbParty::BaseEpisodeRecord
- Inherits:
-
Object
- Object
- TheTvDbParty::BaseEpisodeRecord
- 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.1and1.2that means both records should be combined to make episode1. Cartoons are also known to combine up to 9 episodes together, for example Animaniacs season two. - See Also
Instance Attribute Summary collapse
-
#absolute_number ⇒ Object
readonly
An unsigned integer.
-
#airsafter_season ⇒ Object
readonly
An unsigned integer indicating the season number this episode comes after.
-
#airsbefore_episode ⇒ Object
readonly
An unsigned integer indicating the episode number this special episode airs before.
-
#airsbefore_season ⇒ Object
readonly
An unsigned integer indicating the season number this special episode airs before.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#combined_episodenumber ⇒ Object
readonly
A decimal.
-
#combined_season ⇒ Object
readonly
A decimal.
-
#director ⇒ Object
readonly
An array of directors in plain text.
-
#dvd_chapter ⇒ Object
readonly
Deprecated, was meant to be used to aid in scrapping of actual DVD’s but has never been populated properly.
-
#dvd_discid ⇒ Object
readonly
Deprecated, was meant to be used to aid in scrapping of actual DVD’s but has never been populated properly.
-
#dvd_episodenumber ⇒ Object
readonly
A decimal with one decimal and can be used to join episodes together.
-
#dvd_season ⇒ Object
readonly
An unsigned integer indicating the season the episode was in according to the DVD release.
-
#epimgflag ⇒ Object
readonly
An unsigned integer,
0(zero) if no image is associated with the episode. -
#episodename ⇒ Object
readonly
A string containing the episode name in the language requested.
-
#episodenumber ⇒ Object
readonly
An unsigned integer representing the episode number in its season according to the aired order.
-
#firstaired ⇒ Object
readonly
The date the series first aired.
-
#gueststars ⇒ Object
readonly
An array of the guest stars in that episode.
-
#id ⇒ Object
readonly
An unsigned integer assigned by TheTvDb to the episode.
-
#imagepath_full ⇒ Object
readonly
Returns the full URI of the episode image.
-
#imagepath_relative ⇒ Object
readonly
Returns the relative path of the episode image.
-
#imdb_id ⇒ Object
readonly
An alphanumeric string containing the IMDB ID for the series.
-
#language ⇒ Object
readonly
A two character string indicating the language in accordance with ISO-639-1.
-
#lastupdated ⇒ Object
readonly
The last time any changes were made to the episode record.
-
#overview ⇒ Object
readonly
A string containing the overview in the language requested.
-
#productioncode ⇒ Object
readonly
An alphanumeric string.
-
#rating ⇒ Object
readonly
The average rating users have rated the series out of 10, rounded to 1 decimal place.
-
#ratingcount ⇒ Object
readonly
An unsigned integer representing the number of users who have rated the series.
-
#seasonid ⇒ Object
readonly
An unsigned integer assigned by TheTvDb to the season.
-
#seasonnumber ⇒ Object
readonly
An unsigned integer representing the season number for the episode according to the aired order.
-
#seriesid ⇒ Object
readonly
An unsigned integer assigned by TheTvDb to the series.
-
#thumb_added ⇒ Object
readonly
The date and time the episode image was added to the TheTvDb site.
-
#thumb_height ⇒ Object
readonly
An unsigned integer that represents the height of the episode image in pixels.
-
#thumb_width ⇒ Object
readonly
An unsigned integer that represents the width of the episode image in pixels.
-
#writer ⇒ Object
readonly
An array of the writers of the episode.
Instance Method Summary collapse
-
#get_base_series_record ⇒ Object
Retrieves the Base Series Record for the series this episode belongs to.
-
#initialize(client, hashValues) ⇒ BaseEpisodeRecord
constructor
Initializes a new Base Episode Record as it was retrieved from a given client.
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_number ⇒ Object (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
3episode10listed as50. 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_season ⇒ Object (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_episode ⇒ Object (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_season ⇒ Object (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 |
#client ⇒ Object (readonly)
Returns the value of attribute client.
15 16 17 |
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 15 def client @client end |
#combined_episodenumber ⇒ Object (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_season ⇒ Object (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 |
#director ⇒ Object (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_chapter ⇒ Object (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_discid ⇒ Object (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_episodenumber ⇒ Object (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_season ⇒ Object (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 |
#epimgflag ⇒ Object (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
1or2TheTvDb assumes it’s a proper image, anything above2is 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 |
#episodename ⇒ Object (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 |
#episodenumber ⇒ Object (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 |
#firstaired ⇒ Object (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 |
#gueststars ⇒ Object (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 |
#id ⇒ Object (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_full ⇒ Object (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_relative ⇒ Object (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_id ⇒ Object (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 |
#language ⇒ Object (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 |
#lastupdated ⇒ Object (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 |
#overview ⇒ Object (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 |
#productioncode ⇒ Object (readonly)
An alphanumeric string. Can be null.
76 77 78 |
# File 'lib/thetvdb_party/baseepisoderecord.rb', line 76 def productioncode @productioncode end |
#rating ⇒ Object (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 end |
#ratingcount ⇒ Object (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 end |
#seasonid ⇒ Object (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 |
#seasonnumber ⇒ Object (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 |
#seriesid ⇒ Object (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_added ⇒ Object (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_height ⇒ Object (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_width ⇒ Object (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 |
#writer ⇒ Object (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_record ⇒ Object
Retrieves the Base Series Record for the series this episode belongs to.
- Returns
-
A TheTvDbParty::BaseSeriesRecord instance that represents the series, or
nilif 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 |