thetvdb_api 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/CHANGELOG.md +5 -1
- data/README.md +15 -4
- data/lib/thetvdb_api/actor.rb +29 -12
- data/lib/thetvdb_api/attributes_mapping/search/get_episode.rb +6 -0
- data/lib/thetvdb_api/attributes_mapping/search/get_series.rb +6 -0
- data/lib/thetvdb_api/attributes_mapping/search/get_series_by_remote_id.rb +7 -0
- data/lib/thetvdb_api/banner.rb +29 -12
- data/lib/thetvdb_api/base.rb +0 -24
- data/lib/thetvdb_api/client.rb +4 -0
- data/lib/thetvdb_api/episode.rb +205 -53
- data/lib/thetvdb_api/search.rb +166 -44
- data/lib/thetvdb_api/series.rb +105 -31
- data/lib/thetvdb_api/server.rb +15 -0
- data/lib/thetvdb_api/version.rb +1 -1
- data/lib/thetvdb_api.rb +9 -1
- data/spec/fixtures/server_time.xml +4 -0
- data/spec/functionals/episode_spec.rb +3 -3
- data/spec/functionals/search_spec.rb +9 -9
- data/spec/functionals/series_spec.rb +6 -6
- data/spec/functionals/server_spec.rb +36 -0
- data/spec/integrations/actor_spec.rb +3 -1
- data/spec/integrations/banner_spec.rb +3 -1
- data/spec/integrations/client_spec.rb +54 -11
- data/spec/integrations/episode_spec.rb +11 -3
- data/spec/integrations/search_spec.rb +13 -5
- data/spec/integrations/series_spec.rb +6 -2
- data/spec/integrations/server_spec.rb +16 -0
- data/spec/integrations/update_spec.rb +6 -0
- data/spec/spec_helper.rb +1 -0
- data/thetvdb_api.gemspec +6 -3
- metadata +63 -12
- data/spec/functionals/base_spec.rb +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82c9a99fb9fa13974c7f00e23f00c164433b0022
|
4
|
+
data.tar.gz: 8409f71bc88aea05716703d69449d90e290e8fab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cecac72881ed8dfb87e3da1a1f04caae7e9ef30e21833a0264080a67debac86fff469aa59017129c05169b402a27877f9ecec4aa323557d59aa7f74ba0deefb
|
7
|
+
data.tar.gz: e458d7169560328f73889af865d7731bd9c4d75308c01d6a61e09a1190fdd0c222823c53aab35881bceeca6c5b51324a96d9d0cabbfc5248178ef85e5ee87d18
|
data/.rspec
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.3.0 (September 5, 2014)
|
2
|
+
|
3
|
+
- two way to pass attributes: hash attributes or simple multi attributes (in correct order)
|
4
|
+
|
1
5
|
## 0.2.5 (August 31, 2014)
|
2
6
|
|
3
7
|
- two way access to api (by client class and by each api class)
|
@@ -16,7 +20,7 @@
|
|
16
20
|
## 0.2.3 (January 4, 2014)
|
17
21
|
|
18
22
|
- unit tests refactor
|
19
|
-
-
|
23
|
+
- added functional tests
|
20
24
|
|
21
25
|
## 0.2.2 (December 26, 2013)
|
22
26
|
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/
|
2
|
-
[![Dependency Status](https://gemnasium.com/
|
3
|
-
[![Code Climate](https://codeclimate.com/github/
|
4
|
-
[![Coverage Status](https://coveralls.io/repos/
|
1
|
+
[![Build Status](https://travis-ci.org/tvapi/thetvdb_api.png?branch=master)](https://travis-ci.org/tvapi/thetvdb_api)
|
2
|
+
[![Dependency Status](https://gemnasium.com/tvapi/thetvdb_api.png)](https://gemnasium.com/tvapi/thetvdb_api)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/tvapi/thetvdb_api.png)](https://codeclimate.com/github/tvapi/thetvdb_api)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/tvapi/thetvdb_api/badge.png)](https://coveralls.io/r/tvapi/thetvdb_api)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/thetvdb_api.png)](http://badge.fury.io/rb/thetvdb_api)
|
6
6
|
|
7
7
|
# ThetvdbApi
|
@@ -42,6 +42,7 @@ client.episode # => #<ThetvdbApi::Episode>
|
|
42
42
|
client.search # => #<ThetvdbApi::Search>
|
43
43
|
client.series # => #<ThetvdbApi::Series>
|
44
44
|
client.update # => #<ThetvdbApi::Update>
|
45
|
+
client.server # => #<ThetvdbApi::Server>
|
45
46
|
```
|
46
47
|
|
47
48
|
* II case (direct access to api class, many entry points)
|
@@ -55,6 +56,7 @@ ThetvdbApi::Episode.new(api_key: '...', language: 'en')
|
|
55
56
|
ThetvdbApi::Search.new(api_key: '...', language: 'en')
|
56
57
|
ThetvdbApi::Series.new(api_key: '...', language: 'en')
|
57
58
|
ThetvdbApi::Update.new(api_key: '...', language: 'en')
|
59
|
+
ThetvdbApi::Server.new(api_key: '...', language: 'en')
|
58
60
|
```
|
59
61
|
|
60
62
|
## Methods
|
@@ -112,8 +114,17 @@ For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib
|
|
112
114
|
* find_full
|
113
115
|
* find_full_url
|
114
116
|
|
117
|
+
|
118
|
+
### Server Time method
|
119
|
+
|
120
|
+
For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib/thetvdb_api/server.rb
|
121
|
+
|
122
|
+
* time
|
123
|
+
|
115
124
|
### Update methods
|
116
125
|
|
126
|
+
For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib/thetvdb_api/update.rb
|
127
|
+
|
117
128
|
* day
|
118
129
|
* day_url
|
119
130
|
* week
|
data/lib/thetvdb_api/actor.rb
CHANGED
@@ -1,35 +1,52 @@
|
|
1
1
|
class ThetvdbApi::Actor < ThetvdbApi::Base
|
2
|
+
include Ov
|
3
|
+
|
2
4
|
# Return all of the series actors.
|
3
5
|
#
|
4
6
|
# access: FREE
|
5
|
-
# param
|
6
|
-
# find(series_id)
|
7
|
+
# param:
|
7
8
|
# find(1234)
|
8
|
-
#
|
9
|
+
# output: Faraday::Response instance with parsed XML string
|
10
|
+
# example: http://thetvdb.com/wiki/index.php/API:actors.xml
|
11
|
+
let :find, Any do |series_id|
|
12
|
+
find(series_id: series_id)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Return all of the series actors.
|
16
|
+
#
|
17
|
+
# access: FREE
|
18
|
+
# param:
|
9
19
|
# find(series_id: 1234)
|
10
20
|
# output: Faraday::Response instance with parsed XML string
|
11
21
|
# example: http://thetvdb.com/wiki/index.php/API:actors.xml
|
12
|
-
|
13
|
-
find_path_with_params(
|
22
|
+
let :find, Hash do |options|
|
23
|
+
find_path_with_params(options).get
|
14
24
|
end
|
15
25
|
|
16
26
|
# Return all of the series actors - return only url.
|
17
27
|
#
|
18
28
|
# access: FREE
|
19
|
-
# param
|
20
|
-
# find_url(series_id)
|
29
|
+
# param:
|
21
30
|
# find_url(1234)
|
22
|
-
#
|
31
|
+
# output: url string
|
32
|
+
let :find_url, Any do |series_id|
|
33
|
+
find_url(series_id: series_id)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Return all of the series actors - return only url.
|
37
|
+
#
|
38
|
+
# access: FREE
|
39
|
+
# param:
|
23
40
|
# find_url(series_id: 1234)
|
24
41
|
# output: url string
|
25
|
-
|
26
|
-
find_path_with_params(
|
42
|
+
let :find_url, Hash do |options|
|
43
|
+
find_path_with_params(options).url
|
27
44
|
end
|
28
45
|
|
29
46
|
private
|
30
47
|
|
31
|
-
def find_path_with_params(
|
32
|
-
path(find_path).params(api_key_options.merge(
|
48
|
+
def find_path_with_params(options)
|
49
|
+
path(find_path).params(api_key_options.merge(options))
|
33
50
|
end
|
34
51
|
|
35
52
|
def find_path
|
data/lib/thetvdb_api/banner.rb
CHANGED
@@ -1,35 +1,52 @@
|
|
1
1
|
class ThetvdbApi::Banner < ThetvdbApi::Base
|
2
|
+
include Ov
|
3
|
+
|
2
4
|
# Return all of the series banners.
|
3
5
|
#
|
4
6
|
# access: FREE
|
5
|
-
# param
|
6
|
-
# find(series_id)
|
7
|
+
# param:
|
7
8
|
# find(1234)
|
8
|
-
#
|
9
|
+
# output: Faraday::Response instance with parsed XML string
|
10
|
+
# example: http://thetvdb.com/wiki/index.php/API:banners.xml
|
11
|
+
let :find, Any do |series_id|
|
12
|
+
find(series_id: series_id)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Return all of the series banners.
|
16
|
+
#
|
17
|
+
# access: FREE
|
18
|
+
# param:
|
9
19
|
# find(series_id: 1234)
|
10
20
|
# output: Faraday::Response instance with parsed XML string
|
11
21
|
# example: http://thetvdb.com/wiki/index.php/API:banners.xml
|
12
|
-
|
13
|
-
find_path_with_params(
|
22
|
+
let :find, Hash do |options|
|
23
|
+
find_path_with_params(options).get
|
14
24
|
end
|
15
25
|
|
16
26
|
# Return all of the series banners - return only url.
|
17
27
|
#
|
18
28
|
# access: FREE
|
19
|
-
# param
|
20
|
-
# find_url(series_id)
|
29
|
+
# param:
|
21
30
|
# find_url(1234)
|
22
|
-
#
|
31
|
+
# output: url string
|
32
|
+
let :find_url, Any do |series_id|
|
33
|
+
find_url(series_id: series_id)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Return all of the series banners - return only url.
|
37
|
+
#
|
38
|
+
# access: FREE
|
39
|
+
# param:
|
23
40
|
# find_url(series_id: 1234)
|
24
41
|
# output: url string
|
25
|
-
|
26
|
-
find_path_with_params(
|
42
|
+
let :find_url, Hash do |options|
|
43
|
+
find_path_with_params(options).url
|
27
44
|
end
|
28
45
|
|
29
46
|
private
|
30
47
|
|
31
|
-
def find_path_with_params(
|
32
|
-
path(find_path).params(api_key_options.merge(
|
48
|
+
def find_path_with_params(options)
|
49
|
+
path(find_path).params(api_key_options.merge(options))
|
33
50
|
end
|
34
51
|
|
35
52
|
def find_path
|
data/lib/thetvdb_api/base.rb
CHANGED
@@ -15,30 +15,6 @@ class ThetvdbApi::Base
|
|
15
15
|
api_key_options.merge(language_options)
|
16
16
|
end
|
17
17
|
|
18
|
-
def normalize_series_id_options(*options)
|
19
|
-
normalize_options([:series_id], *options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def normalize_series_id_absolute_options(*options)
|
23
|
-
normalize_options([:series_id, :absolute], *options)
|
24
|
-
end
|
25
|
-
|
26
|
-
def normalize_series_id_episode_options(*options)
|
27
|
-
normalize_options([:series_id, :season, :episode], *options)
|
28
|
-
end
|
29
|
-
|
30
|
-
def normalize_episode_id_options(*options)
|
31
|
-
normalize_options([:episode_id], *options)
|
32
|
-
end
|
33
|
-
|
34
|
-
def normalize_series_name_options(*options)
|
35
|
-
normalize_options({ name: :seriesname }, *options)
|
36
|
-
end
|
37
|
-
|
38
|
-
def normalize_series_id_air_date_options(*options)
|
39
|
-
normalize_options({ series_id: :seriesid, air_date: :airdate }, *options)
|
40
|
-
end
|
41
|
-
|
42
18
|
private
|
43
19
|
|
44
20
|
def uri_kind
|
data/lib/thetvdb_api/client.rb
CHANGED
data/lib/thetvdb_api/episode.rb
CHANGED
@@ -1,116 +1,268 @@
|
|
1
1
|
class ThetvdbApi::Episode < ThetvdbApi::Base
|
2
|
+
include Ov
|
3
|
+
|
2
4
|
# Find the episode data, sorts using the default ordering method.
|
3
5
|
#
|
4
6
|
# access: FREE
|
5
|
-
# param
|
6
|
-
# find_by_default_order(series_id, season, episode)
|
7
|
+
# param:
|
7
8
|
# find_by_default_order(1234, 1, 2)
|
8
|
-
#
|
9
|
+
# output: Faraday::Response instance with parsed XML string
|
10
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
11
|
+
let :find_by_default_order, Any, Any, Any do |series_id, season, episode|
|
12
|
+
find_by_default_order(map_attrs(series_id, season, episode))
|
13
|
+
end
|
14
|
+
|
15
|
+
# Find the episode data, sorts using the default ordering method.
|
16
|
+
#
|
17
|
+
# access: FREE
|
18
|
+
# param:
|
19
|
+
# find_by_default_order(1234, 1, 2, 'de')
|
20
|
+
# output: Faraday::Response instance with parsed XML string
|
21
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
22
|
+
let :find_by_default_order, Any, Any, Any, String do |series_id, season, episode, language|
|
23
|
+
find_by_default_order(map_attrs_with_lang(series_id, season, episode, language))
|
24
|
+
end
|
25
|
+
|
26
|
+
# Find the episode data, sorts using the default ordering method.
|
27
|
+
#
|
28
|
+
# access: FREE
|
29
|
+
# param:
|
9
30
|
# find_by_default_order(series_id: 1234, season: 1, episode: 1)
|
10
31
|
# output: Faraday::Response instance with parsed XML string
|
11
32
|
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
12
|
-
|
13
|
-
find_by_order(
|
33
|
+
let :find_by_default_order, Hash do |options|
|
34
|
+
find_by_order(options.merge(order: 'default'))
|
14
35
|
end
|
15
36
|
|
16
37
|
# Find the episode data, sorts using the default ordering method - return only url.
|
17
38
|
#
|
18
39
|
# access: FREE
|
19
|
-
# param
|
20
|
-
# find_by_default_order_url(series_id, season, episode)
|
40
|
+
# param:
|
21
41
|
# find_by_default_order_url(1234, 1, 2)
|
22
|
-
# param (hash params):
|
23
|
-
# find_by_default_order_url(series_id: 1234, season: 1, episode: 1)
|
24
42
|
# output: url string
|
25
|
-
|
26
|
-
|
43
|
+
let :find_by_default_order_url, Any, Any, Any do |series_id, season, episode|
|
44
|
+
find_by_default_order_url(map_attrs(series_id, season, episode))
|
45
|
+
end
|
46
|
+
|
47
|
+
# Find the episode data, sorts using the default ordering method - return only url.
|
48
|
+
#
|
49
|
+
# access: FREE
|
50
|
+
# param:
|
51
|
+
# find_by_default_order_url(1234, 1, 2, 'de')
|
52
|
+
# output: url string
|
53
|
+
let :find_by_default_order_url, Any, Any, Any, String do |series_id, season, episode, language|
|
54
|
+
find_by_default_order_url(map_attrs_with_lang(series_id, season, episode, language))
|
27
55
|
end
|
28
56
|
|
57
|
+
# Find the episode data, sorts using the default ordering method - return only url.
|
58
|
+
#
|
59
|
+
# access: FREE
|
60
|
+
# param:
|
61
|
+
# find_by_default_order_url(series_id: 1234, season: 1, episode: 1)
|
62
|
+
# output: url string
|
63
|
+
let :find_by_default_order_url, Hash do |options|
|
64
|
+
find_by_order_url(options.merge(order: 'default'))
|
65
|
+
end
|
66
|
+
|
29
67
|
# Find the episode data, sorts using the dvd ordering method.
|
30
68
|
#
|
31
69
|
# access: FREE
|
32
|
-
# param
|
33
|
-
# find_by_dvd_order(series_id, season, episode)
|
70
|
+
# param:
|
34
71
|
# find_by_dvd_order(1234, 1, 2)
|
35
|
-
#
|
72
|
+
# output: Faraday::Response instance with parsed XML string
|
73
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
74
|
+
let :find_by_dvd_order, Any, Any, Any do |series_id, season, episode|
|
75
|
+
find_by_dvd_order(map_attrs(series_id, season, episode))
|
76
|
+
end
|
77
|
+
|
78
|
+
# Find the episode data, sorts using the dvd ordering method.
|
79
|
+
#
|
80
|
+
# access: FREE
|
81
|
+
# param:
|
82
|
+
# find_by_dvd_order(1234, 1, 2, 'de')
|
83
|
+
# output: Faraday::Response instance with parsed XML string
|
84
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
85
|
+
let :find_by_dvd_order, Any, Any, Any, String do |series_id, season, episode, language|
|
86
|
+
find_by_dvd_order(map_attrs_with_lang(series_id, season, episode, language))
|
87
|
+
end
|
88
|
+
|
89
|
+
# Find the episode data, sorts using the dvd ordering method.
|
90
|
+
#
|
91
|
+
# access: FREE
|
92
|
+
# param:
|
36
93
|
# find_by_dvd_order(series_id: 1234, season: 1, episode: 1)
|
37
94
|
# output: Faraday::Response instance with parsed XML string
|
38
95
|
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
39
|
-
|
40
|
-
find_by_order(
|
96
|
+
let :find_by_dvd_order, Hash do |options|
|
97
|
+
find_by_order(options.merge(order: 'dvd'))
|
41
98
|
end
|
42
99
|
|
43
100
|
# Find the episode data, sorts using the dvd ordering method - return only url.
|
44
101
|
#
|
45
102
|
# access: FREE
|
46
|
-
# param:
|
47
|
-
# param (flat params):
|
48
|
-
# find_by_dvd_order_url(series_id, season, episode)
|
103
|
+
# param:
|
49
104
|
# find_by_dvd_order_url(1234, 1, 2)
|
50
|
-
#
|
105
|
+
# output: url string
|
106
|
+
let :find_by_dvd_order_url, Any, Any, Any do |series_id, season, episode|
|
107
|
+
find_by_dvd_order_url(map_attrs(series_id, season, episode))
|
108
|
+
end
|
109
|
+
|
110
|
+
# Find the episode data, sorts using the dvd ordering method - return only url.
|
111
|
+
#
|
112
|
+
# access: FREE
|
113
|
+
# param:
|
114
|
+
# find_by_dvd_order_url(1234, 1, 2, 'de')
|
115
|
+
# output: url string
|
116
|
+
let :find_by_dvd_order_url, Any, Any, Any, String do |series_id, season, episode, language|
|
117
|
+
find_by_dvd_order_url(map_attrs_with_lang(series_id, season, episode, language))
|
118
|
+
end
|
119
|
+
|
120
|
+
# Find the episode data, sorts using the dvd ordering method - return only url.
|
121
|
+
#
|
122
|
+
# access: FREE
|
123
|
+
# param:
|
51
124
|
# find_by_dvd_order_url(series_id: 1234, season: 1, episode: 1)
|
52
125
|
# output: url string
|
53
|
-
|
54
|
-
find_by_order_url(
|
126
|
+
let :find_by_dvd_order_url, Hash do |options|
|
127
|
+
find_by_order_url(options.merge(order: 'dvd'))
|
55
128
|
end
|
56
129
|
|
57
130
|
# Find the episode data, sorts using the absolute ordering method.
|
58
131
|
#
|
59
132
|
# access: FREE
|
60
|
-
# param
|
61
|
-
# find_by_absolute_order(series_id, absolute)
|
133
|
+
# param:
|
62
134
|
# find_by_absolute_order(1234, 1)
|
63
|
-
#
|
135
|
+
# output: Faraday::Response instance with parsed XML string
|
136
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
137
|
+
let :find_by_absolute_order, Any, Any do |series_id, absolute|
|
138
|
+
find_by_absolute_order(series_id: series_id, absolute: absolute)
|
139
|
+
end
|
140
|
+
|
141
|
+
# Find the episode data, sorts using the absolute ordering method.
|
142
|
+
#
|
143
|
+
# access: FREE
|
144
|
+
# param:
|
145
|
+
# find_by_absolute_order(1234, 1, 'de')
|
146
|
+
# output: Faraday::Response instance with parsed XML string
|
147
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
148
|
+
let :find_by_absolute_order, Any, Any, String do |series_id, absolute, language|
|
149
|
+
find_by_absolute_order(series_id: series_id, absolute: absolute, language: language)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Find the episode data, sorts using the absolute ordering method.
|
153
|
+
#
|
154
|
+
# access: FREE
|
155
|
+
# param:
|
64
156
|
# find_by_absolute_order(series_id: 1234, absolute: 1)
|
65
157
|
# output: Faraday::Response instance with parsed XML string
|
66
158
|
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
67
|
-
|
68
|
-
find_by_absolute_order_path_with_params(
|
159
|
+
let :find_by_absolute_order, Hash do |options|
|
160
|
+
find_by_absolute_order_path_with_params(options).get
|
69
161
|
end
|
70
162
|
|
71
163
|
# Find the episode data, sorts using the absolute ordering method - return only url.
|
72
164
|
#
|
73
165
|
# access: FREE
|
74
|
-
# param:
|
75
|
-
# param (flat params):
|
76
|
-
# find_by_absolute_order_url(series_id, absolute)
|
166
|
+
# param:
|
77
167
|
# find_by_absolute_order_url(1234, 1)
|
78
|
-
# param (hash params):
|
79
|
-
# find_by_absolute_order_url(series_id: 1234, absolute: 1)
|
80
168
|
# output: url string
|
81
|
-
|
82
|
-
|
169
|
+
let :find_by_absolute_order_url, Any, Any do |series_id, absolute|
|
170
|
+
find_by_absolute_order_url(series_id: series_id, absolute: absolute)
|
171
|
+
end
|
172
|
+
|
173
|
+
# Find the episode data, sorts using the absolute ordering method - return only url.
|
174
|
+
#
|
175
|
+
# access: FREE
|
176
|
+
# param:
|
177
|
+
# find_by_absolute_order_url(1234, 1, 'de')
|
178
|
+
# output: url string
|
179
|
+
let :find_by_absolute_order_url, Any, Any, String do |series_id, absolute, language|
|
180
|
+
find_by_absolute_order_url(series_id: series_id, absolute: absolute, language: language)
|
83
181
|
end
|
84
182
|
|
85
|
-
# Find the episode data
|
183
|
+
# Find the episode data, sorts using the dvd absolute method - return only url.
|
184
|
+
#
|
185
|
+
# access: FREE
|
186
|
+
# param:
|
187
|
+
# find_by_absolute_order_url(series_id: 1234, absolute: 1)
|
188
|
+
# output: url string
|
189
|
+
let :find_by_absolute_order_url, Hash do |options|
|
190
|
+
find_by_absolute_order_path_with_params(options).url
|
191
|
+
end
|
192
|
+
|
193
|
+
# Find the episode data, sorts using the absolute ordering method.
|
86
194
|
#
|
87
195
|
# access: FREE
|
88
|
-
# param
|
89
|
-
# find(episode_id)
|
196
|
+
# param:
|
90
197
|
# find(1234)
|
91
|
-
# param (hash params):
|
92
|
-
# find(episode_id: 1234)
|
93
198
|
# output: Faraday::Response instance with parsed XML string
|
94
199
|
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
95
|
-
|
96
|
-
|
200
|
+
let :find, Any do |id|
|
201
|
+
find(id: id)
|
97
202
|
end
|
98
203
|
|
99
|
-
# Find the episode data
|
204
|
+
# Find the episode data, sorts using the absolute ordering method.
|
100
205
|
#
|
101
206
|
# access: FREE
|
102
|
-
# param
|
103
|
-
#
|
207
|
+
# param:
|
208
|
+
# find(1234, 'de')
|
209
|
+
# output: Faraday::Response instance with parsed XML string
|
210
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
211
|
+
let :find, Any, String do |id, language|
|
212
|
+
find(id: id, language: language)
|
213
|
+
end
|
214
|
+
|
215
|
+
# Find the episode data, sorts using the absolute ordering method.
|
216
|
+
#
|
217
|
+
# access: FREE
|
218
|
+
# param:
|
219
|
+
# find(id: 1234)
|
220
|
+
# output: Faraday::Response instance with parsed XML string
|
221
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
222
|
+
let :find, Hash do |options|
|
223
|
+
find_path_with_params(options).get
|
224
|
+
end
|
225
|
+
|
226
|
+
# Find the episode data, sorts using the absolute ordering method - return only url.
|
227
|
+
#
|
228
|
+
# access: FREE
|
229
|
+
# param:
|
104
230
|
# find_url(1234)
|
105
|
-
# param (hash params):
|
106
|
-
# find_url(episode_id: 1234)
|
107
231
|
# output: url string
|
108
|
-
|
109
|
-
|
232
|
+
let :find_url, Any do |id|
|
233
|
+
find_url(id: id)
|
234
|
+
end
|
235
|
+
|
236
|
+
# Find the episode data, sorts using the absolute ordering method - return only url.
|
237
|
+
#
|
238
|
+
# access: FREE
|
239
|
+
# param:
|
240
|
+
# find_url(1234, 'de')
|
241
|
+
# output: url string
|
242
|
+
let :find_url, Any, String do |id, language|
|
243
|
+
find_url(id: id, language: language)
|
244
|
+
end
|
245
|
+
|
246
|
+
# Find the episode data, sorts using the dvd absolute method - return only url.
|
247
|
+
#
|
248
|
+
# access: FREE
|
249
|
+
# param:
|
250
|
+
# find_url(id: 1234)
|
251
|
+
# output: url string
|
252
|
+
let :find_url, Hash do |options|
|
253
|
+
find_path_with_params(options).url
|
110
254
|
end
|
111
255
|
|
112
256
|
private
|
113
257
|
|
258
|
+
def map_attrs(series_id, season, episode)
|
259
|
+
{ series_id: series_id, season: season, episode: episode }
|
260
|
+
end
|
261
|
+
|
262
|
+
def map_attrs_with_lang(series_id, season, episode, language)
|
263
|
+
{ series_id: series_id, season: season, episode: episode, language: language }
|
264
|
+
end
|
265
|
+
|
114
266
|
def find_by_order(options)
|
115
267
|
find_by_order_path_with_params(options).get
|
116
268
|
end
|
@@ -127,19 +279,19 @@ class ThetvdbApi::Episode < ThetvdbApi::Base
|
|
127
279
|
':apikey/series/:series_id/:order/:season/:episode/:language.xml'
|
128
280
|
end
|
129
281
|
|
130
|
-
def find_by_absolute_order_path_with_params(
|
131
|
-
path(find_by_absolute_order_path).params(api_key_with_language_options.merge(
|
282
|
+
def find_by_absolute_order_path_with_params(options)
|
283
|
+
path(find_by_absolute_order_path).params(api_key_with_language_options.merge(options))
|
132
284
|
end
|
133
285
|
|
134
286
|
def find_by_absolute_order_path
|
135
287
|
':apikey/series/:series_id/absolute/:absolute/:language.xml'
|
136
288
|
end
|
137
289
|
|
138
|
-
def find_path_with_params(
|
139
|
-
path(find_path).params(api_key_with_language_options.merge(
|
290
|
+
def find_path_with_params(options)
|
291
|
+
path(find_path).params(api_key_with_language_options.merge(options))
|
140
292
|
end
|
141
293
|
|
142
294
|
def find_path
|
143
|
-
':apikey/episodes/:
|
295
|
+
':apikey/episodes/:id/:language.xml'
|
144
296
|
end
|
145
297
|
end
|