Class: TheTvDbParty::Banner

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

Overview

Banner holds information about banners associated with series and seasons.

See Also

thetvdb.com/wiki/index.php/API:banners.xml

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, hashValues) ⇒ Banner

Initializes a new Banner as it was retrieved from a given client.

Parameters
client

The TheTvDbParty::Client instance that retrieved the record this banner belongs to.

hashValues

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


40
41
42
43
44
45
# File 'lib/thetvdb_party/banner.rb', line 40

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

  read_hash_values
end

Instance Attribute Details

Can be appended to <mirrorpath>/banners/ to determine the actual location of the artwork.


10
11
12
# File 'lib/thetvdb_party/banner.rb', line 10

def banner_path_relative
  @banner_path_relative
end

This can be poster, fanart, series or season.


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

def banner_type
  @banner_type
end

For series banners it can be text, graphical, or blank. For season banners it can be season or seasonwide. For fanart it can be 1280x720 or 1920x1080. For poster it will always be 680x1000. Blank banners will leave the title and show logo off the banner. Text banners will show the series name as plain text in an Arial font. Graphical banners will show the series name in the show's official font or will display the actual logo for the show. Season banners are the standard DVD cover format while wide season banners will be the same dimensions as the series banners.


18
19
20
# File 'lib/thetvdb_party/banner.rb', line 18

def banner_type_2
  @banner_type_2
end

#clientObject (readonly)

The client that was used to get this banner


6
7
8
# File 'lib/thetvdb_party/banner.rb', line 6

def client
  @client
end

#dark_accent_colorObject (readonly)

Returns either nil or a RGB color. These are colors the artist picked that go well with the image. It's meant to be used if you want to write something over the image, it gives you a good idea of what colors may work and show up well. Only shows if BannerType is fanart.


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

def dark_accent_color
  @dark_accent_color
end

#idObject (readonly)

Unique ID for this banner


8
9
10
# File 'lib/thetvdb_party/banner.rb', line 8

def id
  @id
end

#languageObject (readonly)

Some banners list the series name in a foreign language. The language abbreviation will be listed here.


20
21
22
# File 'lib/thetvdb_party/banner.rb', line 20

def language
  @language
end

#light_accent_colorObject (readonly)

Returns either nil or a RGB color. These are colors the artist picked that go well with the image. It's meant to be used if you want to write something over the image, it gives you a good idea of what colors may work and show up well. Only shows if BannerType is fanart.


30
31
32
# File 'lib/thetvdb_party/banner.rb', line 30

def light_accent_color
  @light_accent_color
end

#neutral_midtone_colorObject (readonly)

Returns either nil or a RGB color. These are colors the artist picked that go well with the image. It's meant to be used if you want to write something over the image, it gives you a good idea of what colors may work and show up well. Only shows if BannerType is fanart.


34
35
36
# File 'lib/thetvdb_party/banner.rb', line 34

def neutral_midtone_color
  @neutral_midtone_color
end

#ratingObject (readonly)

Either nil or a decimal with four decimal places. The rating the banner currently has on the site.


24
25
26
# File 'lib/thetvdb_party/banner.rb', line 24

def rating
  @rating
end

#rating_countObject (readonly)

Always returns an unsigned integer. Number of people who have rated the image.


26
27
28
# File 'lib/thetvdb_party/banner.rb', line 26

def rating_count
  @rating_count
end

#seasonObject (readonly)

If the banner is for a specific season.


22
23
24
# File 'lib/thetvdb_party/banner.rb', line 22

def season
  @season
end

#series_nameObject (readonly)

This can be true or false. Only shows if BannerType is fanart. Indicates if the seriesname is included in the image or not.


28
29
30
# File 'lib/thetvdb_party/banner.rb', line 28

def series_name
  @series_name
end

#thumbnail_path_relativeObject (readonly)

Used exactly the same way as BannerPath, only shows if BannerType is fanart.


12
13
14
# File 'lib/thetvdb_party/banner.rb', line 12

def thumbnail_path_relative
  @thumbnail_path_relative
end

#vignette_path_relativeObject (readonly)

Returns the value of attribute vignette_path_relative


13
14
15
# File 'lib/thetvdb_party/banner.rb', line 13

def vignette_path_relative
  @vignette_path_relative
end

Instance Method Details


47
48
49
50
51
# File 'lib/thetvdb_party/banner.rb', line 47

def banner_path_full
  if @banner_path_relative
    return (URI::join(BASE_URL, "banners/", @banner_path_relative))
  end
end

#thumbnail_path_fullObject


53
54
55
56
57
# File 'lib/thetvdb_party/banner.rb', line 53

def thumbnail_path_full
  if @thumbnail_path_relative
    return (URI::join(BASE_URL, "banners/", @thumbnail_path_relative))
  end
end

#vignette_path_fullObject


59
60
61
62
63
# File 'lib/thetvdb_party/banner.rb', line 59

def vignette_path_full
  if @vignette_path_relative
    return (URI::join(BASE_URL, "banners/", @vignette_path_relative))
  end
end