thetvdb_mapper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thetvdb_mapper/mapping/banner.rb +1 -0
- data/lib/thetvdb_mapper/mapping/base.rb +1 -1
- data/lib/thetvdb_mapper/mapping/episode.rb +3 -3
- data/lib/thetvdb_mapper/mapping/series.rb +2 -2
- data/lib/thetvdb_mapper/version.rb +1 -1
- data/spec/functionals/mapping/banner_spec.rb +5 -1
- data/spec/functionals/mapping/episode_spec.rb +6 -6
- data/spec/functionals/mapping/series_spec.rb +4 -4
- data/spec/integrations/classes/episode_spec.rb +1 -0
- data/spec/units/mapping/banner_spec.rb +3 -0
- data/spec/units/mapping/base_spec.rb +1 -1
- data/spec/units/mapping/episode_spec.rb +6 -6
- data/spec/units/mapping/series_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebe37c00f3c228440174f44a7116b34e511c15c5
|
4
|
+
data.tar.gz: f28788316945638ff5788bc7ab177fad360a99d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be570ebd08931b688b006150aaa88080ce7ff57bcf74c5bb0da7b6c4b0ebc48ed1d4ed017af73b57535dba5887f5c705b523b97c155bbedf5b4ade87afdaf85a
|
7
|
+
data.tar.gz: c0decaf79aa02a7657cffc7b58565af84a0254d2b15f9aa7873c7b763327ddbdddf29d9c4668d927c05cd3766d0377465a209241b210cf7dabda03c5ccee0383
|
@@ -26,11 +26,11 @@ class ThetvdbMapper::Mapping::Episode < ThetvdbMapper::Mapping::Base
|
|
26
26
|
'airsbefore_season' => :airs_before_season,
|
27
27
|
'filename' => :filename_path,
|
28
28
|
'lastupdated' => :last_updated_at,
|
29
|
-
'
|
30
|
-
'
|
29
|
+
'seasonid' => :season_id,
|
30
|
+
'seriesid' => :series_id,
|
31
31
|
'thumb_added' => :thumbnail_added_at,
|
32
32
|
'thumb_height' => :thumbnail_height,
|
33
|
-
'
|
33
|
+
'thumb_width' => :thumbnail_width
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -6,7 +6,7 @@ class ThetvdbMapper::Mapping::Series < ThetvdbMapper::Mapping::Base
|
|
6
6
|
'Airs_Time' => :airs_time,
|
7
7
|
'ContentRating' => :content_rating,
|
8
8
|
'FirstAired' => :first_aired,
|
9
|
-
'
|
9
|
+
'Genre' => :genres,
|
10
10
|
'IMDB_ID' => :imdb_id,
|
11
11
|
'Language' => :language,
|
12
12
|
'Network' => :network,
|
@@ -18,7 +18,7 @@ class ThetvdbMapper::Mapping::Series < ThetvdbMapper::Mapping::Base
|
|
18
18
|
'SeriesName' => :name,
|
19
19
|
'Status' => :status,
|
20
20
|
'added' => :added_at,
|
21
|
-
'
|
21
|
+
'addedBy' => :added_by,
|
22
22
|
'banner' => :banner_path,
|
23
23
|
'fanart' => :fanart_path,
|
24
24
|
'lastupdated' => :last_updated_at,
|
@@ -6,7 +6,11 @@ describe ThetvdbMapper::Mapping::Banner do
|
|
6
6
|
describe '#map' do
|
7
7
|
it 'should return specific keys' do
|
8
8
|
klass.map({}).keys.sort.should == [:path, :thumbnail_path, :vignette_path, :type, :type2, :language, :season,
|
9
|
-
|
9
|
+
:rating, :rating_count, :series_name, :colors, :id].sort
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should map id' do
|
13
|
+
klass.map('id' => '1')[:id].should == '1'
|
10
14
|
end
|
11
15
|
|
12
16
|
it 'should map BannerPath' do
|
@@ -112,12 +112,12 @@ describe ThetvdbMapper::Mapping::Episode do
|
|
112
112
|
klass.map('lastupdated' => '1234')[:last_updated_at].should == Time.at(1234)
|
113
113
|
end
|
114
114
|
|
115
|
-
it 'should map
|
116
|
-
klass.map('
|
115
|
+
it 'should map seasonid' do
|
116
|
+
klass.map('seasonid' => '1')[:season_id].should == '1'
|
117
117
|
end
|
118
118
|
|
119
|
-
it 'should map
|
120
|
-
klass.map('
|
119
|
+
it 'should map seriesid' do
|
120
|
+
klass.map('seriesid' => '1')[:series_id].should == '1'
|
121
121
|
end
|
122
122
|
|
123
123
|
it 'should map thumb_added' do
|
@@ -128,8 +128,8 @@ describe ThetvdbMapper::Mapping::Episode do
|
|
128
128
|
klass.map('thumb_height' => 'test')[:thumbnail_height].should == 'test'
|
129
129
|
end
|
130
130
|
|
131
|
-
it 'should map
|
132
|
-
klass.map('
|
131
|
+
it 'should map thumb_width' do
|
132
|
+
klass.map('thumb_width' => 'test')[:thumbnail_width].should == 'test'
|
133
133
|
end
|
134
134
|
end
|
135
135
|
end
|
@@ -30,8 +30,8 @@ describe ThetvdbMapper::Mapping::Series do
|
|
30
30
|
klass.map('FirstAired' => '1997-07-01')[:first_aired].should == '1997-07-01'
|
31
31
|
end
|
32
32
|
|
33
|
-
it 'should map
|
34
|
-
klass.map('
|
33
|
+
it 'should map Genre' do
|
34
|
+
klass.map('Genre' => '|comedy|')[:genres].should == ['comedy']
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'should map IMDB_ID' do
|
@@ -78,8 +78,8 @@ describe ThetvdbMapper::Mapping::Series do
|
|
78
78
|
klass.map('added' => '1')[:added_at].should == '1'
|
79
79
|
end
|
80
80
|
|
81
|
-
it 'should map
|
82
|
-
klass.map('
|
81
|
+
it 'should map addedBy' do
|
82
|
+
klass.map('addedBy' => '1')[:added_by].should == '1'
|
83
83
|
end
|
84
84
|
|
85
85
|
it 'should map banner' do
|
@@ -15,7 +15,7 @@ describe ThetvdbMapper::Mapping::Banner do
|
|
15
15
|
|
16
16
|
it 'should call convert method if exists' do
|
17
17
|
klass.stub(:respond_to?).with(:convert).and_return(true)
|
18
|
-
klass.should_receive(:convert)
|
18
|
+
klass.should_receive(:convert).and_return({})
|
19
19
|
klass.map(sample: 'test')
|
20
20
|
end
|
21
21
|
end
|
@@ -104,12 +104,12 @@ describe ThetvdbMapper::Mapping::Episode do
|
|
104
104
|
klass.rules['lastupdated'].should == :last_updated_at
|
105
105
|
end
|
106
106
|
|
107
|
-
it 'should map
|
108
|
-
klass.rules['
|
107
|
+
it 'should map seasonid' do
|
108
|
+
klass.rules['seasonid'].should == :season_id
|
109
109
|
end
|
110
110
|
|
111
|
-
it 'should map
|
112
|
-
klass.rules['
|
111
|
+
it 'should map seriesid' do
|
112
|
+
klass.rules['seriesid'].should == :series_id
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'should map thumb_added' do
|
@@ -120,8 +120,8 @@ describe ThetvdbMapper::Mapping::Episode do
|
|
120
120
|
klass.rules['thumb_height'].should == :thumbnail_height
|
121
121
|
end
|
122
122
|
|
123
|
-
it 'should map
|
124
|
-
klass.rules['
|
123
|
+
it 'should map thumb_width' do
|
124
|
+
klass.rules['thumb_width'].should == :thumbnail_width
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
@@ -24,8 +24,8 @@ describe ThetvdbMapper::Mapping::Series do
|
|
24
24
|
klass.rules['FirstAired'].should == :first_aired
|
25
25
|
end
|
26
26
|
|
27
|
-
it 'should map
|
28
|
-
klass.rules['
|
27
|
+
it 'should map Genre' do
|
28
|
+
klass.rules['Genre'].should == :genres
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'should map IMDB_ID' do
|
@@ -72,8 +72,8 @@ describe ThetvdbMapper::Mapping::Series do
|
|
72
72
|
klass.rules['added'].should == :added_at
|
73
73
|
end
|
74
74
|
|
75
|
-
it 'should map
|
76
|
-
klass.rules['
|
75
|
+
it 'should map addedBy' do
|
76
|
+
klass.rules['addedBy'].should == :added_by
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'should map banner' do
|