Class: ThetvdbMapper::Mapping::Episode

Inherits:
Base
  • Object
show all
Defined in:
lib/thetvdb_mapper/mapping/episode.rb

Class Method Summary collapse

Methods inherited from Base

convert_to_list, map

Class Method Details

.convert(data) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/thetvdb_mapper/mapping/episode.rb', line 37

def self.convert(data)
  data.merge({
    director: convert_to_list(data[:director]),
    guest_stars: convert_to_list(data[:guest_stars]),
    writer: convert_to_list(data[:writer]),
    last_updated_at: Time.at(data[:last_updated_at].to_i)
  })
end

.rulesObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/thetvdb_mapper/mapping/episode.rb', line 2

def self.rules
  {
    'id' => :id,
    'Combined_episodenumber' => :combined_episode_number,
    'Combined_season' => :combined_season,
    'DVD_episodenumber' => :dvd_episode_number,
    'DVD_season' => :dvd_season,
    'Director' => :director,
    'EpImgFlag' => :ep_img_flag,
    'EpisodeName' => :name,
    'EpisodeNumber' => :number,
    'FirstAired' => :first_aired,
    'GuestStars' => :guest_stars,
    'IMDB_ID' => :imdb_id,
    'Language' => :language,
    'Overview' => :overview,
    'ProductionCode' => :production_code,
    'Rating' => :rating,
    'RatingCount' => :rating_count,
    'SeasonNumber' => :season,
    'Writer' => :writer,
    'absolute_number' => :absolute_number,
    'airsafter_season' => :airs_after_season,
    'airsbefore_episode' => :airs_before_episode,
    'airsbefore_season' => :airs_before_season,
    'filename' => :filename_path,
    'lastupdated' => :last_updated_at,
    'season_id' => :season_id,
    'series_id' => :series_id,
    'thumb_added' => :thumbnail_added_at,
    'thumb_height' => :thumbnail_height,
    'thumb_weight' => :thumbnail_width
  }
end