thetvdb_api 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -15
- data/CHANGELOG.md +53 -0
- data/README.md +80 -103
- data/lib/thetvdb_api/actor.rb +18 -11
- data/lib/thetvdb_api/banner.rb +18 -11
- data/lib/thetvdb_api/base.rb +24 -0
- data/lib/thetvdb_api/episode.rb +68 -48
- data/lib/thetvdb_api/search.rb +85 -28
- data/lib/thetvdb_api/series.rb +36 -22
- data/lib/thetvdb_api/update.rb +8 -4
- data/lib/thetvdb_api/version.rb +1 -1
- data/spec/functionals/actor_spec.rb +26 -6
- data/spec/functionals/banner_spec.rb +26 -6
- data/spec/functionals/base_spec.rb +79 -0
- data/spec/functionals/episode_spec.rb +120 -28
- data/spec/functionals/search_spec.rb +143 -25
- data/spec/functionals/series_spec.rb +54 -14
- data/spec/functionals/update_spec.rb +12 -12
- data/spec/integrations/actor_spec.rb +14 -0
- data/spec/integrations/banner_spec.rb +14 -0
- data/spec/integrations/client_spec.rb +150 -0
- data/spec/integrations/episode_spec.rb +43 -0
- data/spec/integrations/search_spec.rb +41 -0
- data/spec/integrations/series_spec.rb +23 -0
- data/spec/integrations/update_spec.rb +32 -0
- data/spec/spec_helper.rb +1 -4
- data/spec/support/.keep +0 -0
- data/spec/support/api_key.rb.example +1 -0
- data/thetvdb_api.gemspec +2 -2
- metadata +29 -24
- data/spec/integrations/classes/actor_spec.rb +0 -13
- data/spec/integrations/classes/banner_spec.rb +0 -13
- data/spec/integrations/classes/client_spec.rb +0 -109
- data/spec/integrations/classes/episode_spec.rb +0 -31
- data/spec/integrations/classes/search_spec.rb +0 -31
- data/spec/integrations/classes/series_spec.rb +0 -19
- data/spec/integrations/classes/update_spec.rb +0 -31
- data/spec/integrations/integration_spec_helper.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a80e13185840b4ed5e40060728b17b84ff3c645
|
4
|
+
data.tar.gz: bebfb5dc9fd816cddf862621474217e426bb7984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51adfb641d58aaaded7106912338cd815f9c506eec77bbbca190b71d1320396b00d066b946aaa4f7e804ba9b1dbb9e38dc527c1b5e6aa1666a29f7e420802f51
|
7
|
+
data.tar.gz: 2d5f32df776673a941eb72eb22fb4dc94dba7dc5cf69099a7d7cba2ed9b2c5305320735a8bf3a481f19098b94877abb53fbd2634224c8ecdb5f8b22f2110dde0
|
data/.gitignore
CHANGED
@@ -1,19 +1,5 @@
|
|
1
1
|
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
2
|
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
3
|
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
4
|
|
19
|
-
spec/
|
5
|
+
spec/support/api_key.rb
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
## 0.2.5 (August 31, 2014)
|
2
|
+
|
3
|
+
- two way access to api (by client class and by each api class)
|
4
|
+
|
5
|
+
## 0.2.4 (June 23, 2014)
|
6
|
+
|
7
|
+
- removed unit tests
|
8
|
+
- use service_api gem for common parts
|
9
|
+
- use option hash attribute in every method instead of many String attributes
|
10
|
+
- added tests
|
11
|
+
|
12
|
+
## 0.2.3.1 (February 2, 2014)
|
13
|
+
|
14
|
+
- update Faraday
|
15
|
+
|
16
|
+
## 0.2.3 (January 4, 2014)
|
17
|
+
|
18
|
+
- unit tests refactor
|
19
|
+
- addded functional tests
|
20
|
+
|
21
|
+
## 0.2.2 (December 26, 2013)
|
22
|
+
|
23
|
+
- removed mappers
|
24
|
+
- use multi_xml to parse XML response
|
25
|
+
- wrapped Faraday response by own class
|
26
|
+
- added methods which return url instead call to API
|
27
|
+
|
28
|
+
## 0.2.1 (December 21, 2013)
|
29
|
+
|
30
|
+
- hotfix
|
31
|
+
|
32
|
+
## 0.2.0 (December 21, 2013)
|
33
|
+
|
34
|
+
- replaced HTTParty by Faraday
|
35
|
+
- refactored Mapper classes
|
36
|
+
|
37
|
+
## 0.1.2 (December 17, 2013)
|
38
|
+
|
39
|
+
- used uri_template for better way to format uri and map variables
|
40
|
+
|
41
|
+
## 0.1.1 (December 14, 2013)
|
42
|
+
|
43
|
+
- refactored
|
44
|
+
|
45
|
+
## 0.1.0 (December 11, 2013)
|
46
|
+
|
47
|
+
- removed monkey patches for Ruby Core Date Types
|
48
|
+
- removed mapping response to objects
|
49
|
+
- little performance improvement
|
50
|
+
|
51
|
+
## 0.0.1 (December 4, 2013)
|
52
|
+
|
53
|
+
First release with HTTParty
|
data/README.md
CHANGED
@@ -8,143 +8,120 @@
|
|
8
8
|
|
9
9
|
thetvdb_api is a simple ruby client for accessing TV shows information from the thetvdb.com API.
|
10
10
|
|
11
|
-
##
|
11
|
+
## Installation
|
12
12
|
|
13
|
-
|
13
|
+
With Bundler:
|
14
14
|
|
15
15
|
```ruby
|
16
16
|
gem 'thetvdb_api'
|
17
17
|
```
|
18
18
|
|
19
|
-
|
19
|
+
```ruby
|
20
|
+
$ bundle install
|
21
|
+
```
|
22
|
+
|
23
|
+
Otherwhise:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
gem install thetvdb_api
|
27
|
+
```
|
20
28
|
|
21
29
|
## How to use
|
22
30
|
|
23
31
|
You have two way for access to api:
|
24
32
|
|
25
|
-
* I
|
26
|
-
|
27
|
-
* II way (direct access to api class, many entry points)
|
33
|
+
* I case (create client class, one entry point)
|
28
34
|
|
29
|
-
|
35
|
+
Language attribute is optional with default value 'en'
|
30
36
|
|
31
37
|
```ruby
|
32
38
|
client = ThetvdbApi::Client.new(api_key: '...', language: 'en')
|
33
|
-
client.
|
34
|
-
client.
|
35
|
-
client.
|
36
|
-
client.search
|
37
|
-
client.
|
38
|
-
client.
|
39
|
+
client.actor # => #<ThetvdbApi::Actor>
|
40
|
+
client.banner # => #<ThetvdbApi::Banner>
|
41
|
+
client.episode # => #<ThetvdbApi::Episode>
|
42
|
+
client.search # => #<ThetvdbApi::Search>
|
43
|
+
client.series # => #<ThetvdbApi::Series>
|
44
|
+
client.update # => #<ThetvdbApi::Update>
|
39
45
|
```
|
40
46
|
|
41
|
-
|
42
|
-
search = ThetvdbApi::Search.new(api_key: '...', language: 'en')
|
43
|
-
search.get_series(options = {})
|
44
|
-
search.get_series_url(options = {}) # return only full url
|
45
|
-
search.get_series_by_remote_id(options = {})
|
46
|
-
search.get_series_by_remote_id_url(options = {}) # return only full url
|
47
|
-
search.get_episode(options = {})
|
48
|
-
search.get_episode_url(options = {}) # return only full url
|
49
|
-
```
|
47
|
+
* II case (direct access to api class, many entry points)
|
50
48
|
|
51
|
-
|
49
|
+
Language attribute is required
|
52
50
|
|
53
51
|
```ruby
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
52
|
+
ThetvdbApi::Actor.new(api_key: '...', language: 'en')
|
53
|
+
ThetvdbApi::Banner.new(api_key: '...', language: 'en')
|
54
|
+
ThetvdbApi::Episode.new(api_key: '...', language: 'en')
|
55
|
+
ThetvdbApi::Search.new(api_key: '...', language: 'en')
|
56
|
+
ThetvdbApi::Series.new(api_key: '...', language: 'en')
|
57
|
+
ThetvdbApi::Update.new(api_key: '...', language: 'en')
|
59
58
|
```
|
60
59
|
|
61
|
-
|
62
|
-
client = ThetvdbApi::Series.new(api_key: '...', language: 'en')
|
63
|
-
series.find(options = {})
|
64
|
-
series.find_url(options = {}) # return only full url
|
65
|
-
series.find_full(options = {})
|
66
|
-
series.find_full_url(options = {}) # return only full url
|
67
|
-
```
|
60
|
+
## Methods
|
68
61
|
|
69
|
-
|
62
|
+
For almost all method you can pass hash attributes or multiple attributes specified in method comment (except some methods in Search class).
|
70
63
|
|
71
|
-
|
72
|
-
client = ThetvdbApi::Client.new(api_key: '...', language: 'en')
|
73
|
-
client.actor.all(options = {})
|
74
|
-
client.actor.all_url(options = {}) # return only full url
|
75
|
-
```
|
64
|
+
### Actor methods
|
76
65
|
|
77
|
-
|
78
|
-
actor = ThetvdbApi::Actor.new(api_key: '...', language: 'en')
|
79
|
-
actor.all(options = {})
|
80
|
-
actor.all_url(options = {}) # return only full url
|
81
|
-
```
|
66
|
+
For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib/thetvdb_api/actor.rb
|
82
67
|
|
83
|
-
|
68
|
+
* all
|
69
|
+
* all_url
|
84
70
|
|
85
|
-
|
86
|
-
client = ThetvdbApi::Client.new(api_key: '...', language: 'en')
|
87
|
-
client.banner.all(options = {})
|
88
|
-
client.banner.all_url(options = {}) # return only full url
|
89
|
-
```
|
71
|
+
### Banner methods
|
90
72
|
|
91
|
-
|
92
|
-
banner = ThetvdbApi::Banner.new(api_key: '...', language: 'en')
|
93
|
-
banner.all(options = {})
|
94
|
-
banner.all_url(options = {}) # return only full url
|
95
|
-
```
|
73
|
+
For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib/thetvdb_api/banner.rb
|
96
74
|
|
97
|
-
|
75
|
+
* all
|
76
|
+
* all_url
|
98
77
|
|
99
|
-
|
100
|
-
client = ThetvdbApi::Client.new(api_key: '...', language: 'en')
|
101
|
-
client.episode.find_by_default_order(options = {})
|
102
|
-
client.episode.find_by_default_order_url(options = {}) # return only full url
|
103
|
-
client.episode.find_by_dvd_order(options = {})
|
104
|
-
client.episode.find_by_dvd_order_url(options = {}) # return only full url
|
105
|
-
client.episode.find_by_absolute_order(options = {})
|
106
|
-
client.episode.find_by_absolute_order_url(options = {}) # return only full url
|
107
|
-
client.episode.find(options = {})
|
108
|
-
client.episode.find_url(options = {}) # return only full url
|
109
|
-
```
|
78
|
+
### Episode methods
|
110
79
|
|
111
|
-
|
112
|
-
episode = ThetvdbApi::Episode.new(api_key: '...', language: 'en')
|
113
|
-
episode.find_by_default_order(options = {})
|
114
|
-
episode.find_by_default_order_url(options = {}) # return only full url
|
115
|
-
episode.find_by_dvd_order(options = {})
|
116
|
-
episode.find_by_dvd_order_url(options = {}) # return only full url
|
117
|
-
episode.find_by_absolute_order(options = {})
|
118
|
-
episode.find_by_absolute_order_url(options = {}) # return only full url
|
119
|
-
episode.find(options = {})
|
120
|
-
episode.find_url(options = {}) # return only full url
|
121
|
-
```
|
80
|
+
For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib/thetvdb_api/episode.rb
|
122
81
|
|
123
|
-
|
82
|
+
* find
|
83
|
+
* find_url
|
84
|
+
* find_by_absolute_order
|
85
|
+
* find_by_absolute_order_url
|
86
|
+
* find_by_default_order
|
87
|
+
* find_by_default_order_url
|
88
|
+
* find_by_dvd_order
|
89
|
+
* find_by_dvd_order_url
|
124
90
|
|
125
|
-
|
126
|
-
client = ThetvdbApi::Client.new(api_key: '...', language: 'en')
|
127
|
-
client.update.day
|
128
|
-
client.update.day_url # return only full url
|
129
|
-
client.update.week
|
130
|
-
client.update.week_url # return only full url
|
131
|
-
client.update.month
|
132
|
-
client.update.month_url # return only full url
|
133
|
-
client.update.all
|
134
|
-
client.update.all_url # return only full url
|
135
|
-
```
|
91
|
+
### Search methods
|
136
92
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
93
|
+
For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib/thetvdb_api/search.rb
|
94
|
+
|
95
|
+
* get_series
|
96
|
+
* get_series_url
|
97
|
+
* get_series_by_remote
|
98
|
+
* get_series_by_remote_url
|
99
|
+
* get_series_by_imdb_id
|
100
|
+
* get_series_by_imdb_id_url
|
101
|
+
* get_series_by_zap2it_id
|
102
|
+
* get_series_by_zap2it_id_url
|
103
|
+
* get_episode
|
104
|
+
* get_episode_url
|
105
|
+
|
106
|
+
### Series methods
|
107
|
+
|
108
|
+
For method attributes read https://github.com/wafcio/thetvdb_api/blob/master/lib/thetvdb_api/series.rb
|
109
|
+
|
110
|
+
* find
|
111
|
+
* find_url
|
112
|
+
* find_full
|
113
|
+
* find_full_url
|
114
|
+
|
115
|
+
### Update methods
|
116
|
+
|
117
|
+
* day
|
118
|
+
* day_url
|
119
|
+
* week
|
120
|
+
* week_url
|
121
|
+
* month
|
122
|
+
* month_url
|
123
|
+
* all
|
124
|
+
* all_url
|
148
125
|
|
149
126
|
## Contributing
|
150
127
|
|
data/lib/thetvdb_api/actor.rb
CHANGED
@@ -2,27 +2,34 @@ class ThetvdbApi::Actor < ThetvdbApi::Base
|
|
2
2
|
# Return all of the series actors.
|
3
3
|
#
|
4
4
|
# access: FREE
|
5
|
-
# param
|
6
|
-
# series_id
|
7
|
-
#
|
8
|
-
|
9
|
-
|
5
|
+
# param (flat params):
|
6
|
+
# find(series_id)
|
7
|
+
# find(1234)
|
8
|
+
# param (hash params):
|
9
|
+
# find(series_id: 1234)
|
10
|
+
# output: Faraday::Response instance with parsed XML string
|
11
|
+
# example: http://thetvdb.com/wiki/index.php/API:actors.xml
|
12
|
+
def find(*options)
|
13
|
+
find_path_with_params(*options).get
|
10
14
|
end
|
11
15
|
|
12
16
|
# Return all of the series actors - return only url.
|
13
17
|
#
|
14
18
|
# access: FREE
|
15
|
-
# param
|
16
|
-
# series_id
|
19
|
+
# param (flat params):
|
20
|
+
# find_url(series_id)
|
21
|
+
# find_url(1234)
|
22
|
+
# param (hash params):
|
23
|
+
# find_url(series_id: 1234)
|
17
24
|
# output: url string
|
18
|
-
def find_url(options
|
19
|
-
find_path_with_params(options).url
|
25
|
+
def find_url(*options)
|
26
|
+
find_path_with_params(*options).url
|
20
27
|
end
|
21
28
|
|
22
29
|
private
|
23
30
|
|
24
|
-
def find_path_with_params(options)
|
25
|
-
path(find_path).params(api_key_options.merge(options))
|
31
|
+
def find_path_with_params(*options)
|
32
|
+
path(find_path).params(api_key_options.merge(normalize_series_id_options(*options)))
|
26
33
|
end
|
27
34
|
|
28
35
|
def find_path
|
data/lib/thetvdb_api/banner.rb
CHANGED
@@ -2,27 +2,34 @@ class ThetvdbApi::Banner < ThetvdbApi::Base
|
|
2
2
|
# Return all of the series banners.
|
3
3
|
#
|
4
4
|
# access: FREE
|
5
|
-
# param
|
6
|
-
# series_id
|
7
|
-
#
|
8
|
-
|
9
|
-
|
5
|
+
# param (flat params):
|
6
|
+
# find(series_id)
|
7
|
+
# find(1234)
|
8
|
+
# param (hash params):
|
9
|
+
# find(series_id: 1234)
|
10
|
+
# output: Faraday::Response instance with parsed XML string
|
11
|
+
# example: http://thetvdb.com/wiki/index.php/API:banners.xml
|
12
|
+
def find(*options)
|
13
|
+
find_path_with_params(*options).get
|
10
14
|
end
|
11
15
|
|
12
16
|
# Return all of the series banners - return only url.
|
13
17
|
#
|
14
18
|
# access: FREE
|
15
|
-
# param
|
16
|
-
# series_id
|
19
|
+
# param (flat params):
|
20
|
+
# find_url(series_id)
|
21
|
+
# find_url(1234)
|
22
|
+
# param (hash params):
|
23
|
+
# find_url(series_id: 1234)
|
17
24
|
# output: url string
|
18
|
-
def find_url(options
|
19
|
-
find_path_with_params(options).url
|
25
|
+
def find_url(*options)
|
26
|
+
find_path_with_params(*options).url
|
20
27
|
end
|
21
28
|
|
22
29
|
private
|
23
30
|
|
24
|
-
def find_path_with_params(options)
|
25
|
-
path(find_path).params(api_key_options.merge(options))
|
31
|
+
def find_path_with_params(*options)
|
32
|
+
path(find_path).params(api_key_options.merge(normalize_series_id_options(*options)))
|
26
33
|
end
|
27
34
|
|
28
35
|
def find_path
|
data/lib/thetvdb_api/base.rb
CHANGED
@@ -15,6 +15,30 @@ 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
|
+
|
18
42
|
private
|
19
43
|
|
20
44
|
def uri_kind
|
data/lib/thetvdb_api/episode.rb
CHANGED
@@ -2,91 +2,111 @@ class ThetvdbApi::Episode < ThetvdbApi::Base
|
|
2
2
|
# Find the episode data, sorts using the default ordering method.
|
3
3
|
#
|
4
4
|
# access: FREE
|
5
|
-
# param
|
6
|
-
# series_id
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
|
11
|
-
|
5
|
+
# param (flat params):
|
6
|
+
# find_by_default_order(series_id, season, episode)
|
7
|
+
# find_by_default_order(1234, 1, 2)
|
8
|
+
# param (hash params):
|
9
|
+
# find_by_default_order(series_id: 1234, season: 1, episode: 1)
|
10
|
+
# output: Faraday::Response instance with parsed XML string
|
11
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
12
|
+
def find_by_default_order(*options)
|
13
|
+
find_by_order(normalize_series_id_episode_options(*options).merge(order: 'default'))
|
12
14
|
end
|
13
15
|
|
14
16
|
# Find the episode data, sorts using the default ordering method - return only url.
|
15
17
|
#
|
16
18
|
# access: FREE
|
17
|
-
# param
|
18
|
-
# series_id
|
19
|
-
#
|
20
|
-
#
|
19
|
+
# param (flat params):
|
20
|
+
# find_by_default_order_url(series_id, season, episode)
|
21
|
+
# 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)
|
21
24
|
# output: url string
|
22
|
-
def find_by_default_order_url(options
|
23
|
-
find_by_order_url(options.merge(order: 'default'))
|
25
|
+
def find_by_default_order_url(*options)
|
26
|
+
find_by_order_url(normalize_series_id_episode_options(*options).merge(order: 'default'))
|
24
27
|
end
|
25
28
|
|
26
29
|
# Find the episode data, sorts using the dvd ordering method.
|
27
30
|
#
|
28
31
|
# access: FREE
|
29
|
-
# param
|
30
|
-
# series_id
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
|
35
|
-
|
32
|
+
# param (flat params):
|
33
|
+
# find_by_dvd_order(series_id, season, episode)
|
34
|
+
# find_by_dvd_order(1234, 1, 2)
|
35
|
+
# param (hash params):
|
36
|
+
# find_by_dvd_order(series_id: 1234, season: 1, episode: 1)
|
37
|
+
# output: Faraday::Response instance with parsed XML string
|
38
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
39
|
+
def find_by_dvd_order(*options)
|
40
|
+
find_by_order(normalize_series_id_episode_options(*options).merge(order: 'dvd'))
|
36
41
|
end
|
37
42
|
|
38
43
|
# Find the episode data, sorts using the dvd ordering method - return only url.
|
39
44
|
#
|
40
45
|
# access: FREE
|
41
46
|
# param: options hash
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
47
|
+
# param (flat params):
|
48
|
+
# find_by_dvd_order_url(series_id, season, episode)
|
49
|
+
# find_by_dvd_order_url(1234, 1, 2)
|
50
|
+
# param (hash params):
|
51
|
+
# find_by_dvd_order_url(series_id: 1234, season: 1, episode: 1)
|
45
52
|
# output: url string
|
46
|
-
def find_by_dvd_order_url(options
|
47
|
-
find_by_order_url(options.merge(order: 'dvd'))
|
53
|
+
def find_by_dvd_order_url(*options)
|
54
|
+
find_by_order_url(normalize_series_id_episode_options(*options).merge(order: 'dvd'))
|
48
55
|
end
|
49
56
|
|
50
57
|
# Find the episode data, sorts using the absolute ordering method.
|
51
58
|
#
|
52
59
|
# access: FREE
|
53
|
-
# param
|
54
|
-
# series_id
|
55
|
-
#
|
56
|
-
#
|
57
|
-
|
58
|
-
|
60
|
+
# param (flat params):
|
61
|
+
# find_by_absolute_order(series_id, absolute)
|
62
|
+
# find_by_absolute_order(1234, 1)
|
63
|
+
# param (hash params):
|
64
|
+
# find_by_absolute_order(series_id: 1234, absolute: 1)
|
65
|
+
# output: Faraday::Response instance with parsed XML string
|
66
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
67
|
+
def find_by_absolute_order(*options)
|
68
|
+
find_by_absolute_order_path_with_params(*options).get
|
59
69
|
end
|
60
70
|
|
61
71
|
# Find the episode data, sorts using the absolute ordering method - return only url.
|
62
72
|
#
|
63
73
|
# access: FREE
|
64
74
|
# param: options hash
|
65
|
-
#
|
66
|
-
#
|
75
|
+
# param (flat params):
|
76
|
+
# find_by_absolute_order_url(series_id, absolute)
|
77
|
+
# find_by_absolute_order_url(1234, 1)
|
78
|
+
# param (hash params):
|
79
|
+
# find_by_absolute_order_url(series_id: 1234, absolute: 1)
|
67
80
|
# output: url string
|
68
|
-
def find_by_absolute_order_url(options
|
69
|
-
find_by_absolute_order_path_with_params(options).url
|
81
|
+
def find_by_absolute_order_url(*options)
|
82
|
+
find_by_absolute_order_path_with_params(*options).url
|
70
83
|
end
|
71
84
|
|
72
85
|
# Find the episode data by episode id.
|
73
86
|
#
|
74
87
|
# access: FREE
|
75
|
-
# param
|
76
|
-
# episode_id
|
77
|
-
#
|
78
|
-
|
79
|
-
|
88
|
+
# param (flat params):
|
89
|
+
# find(episode_id)
|
90
|
+
# find(1234)
|
91
|
+
# param (hash params):
|
92
|
+
# find(episode_id: 1234)
|
93
|
+
# output: Faraday::Response instance with parsed XML string
|
94
|
+
# example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record
|
95
|
+
def find(*options)
|
96
|
+
find_path_with_params(*options).get
|
80
97
|
end
|
81
98
|
|
82
99
|
# Find the episode data by episode id - return only url.
|
83
100
|
#
|
84
101
|
# access: FREE
|
85
|
-
# param
|
86
|
-
# episode_id
|
102
|
+
# param (flat params):
|
103
|
+
# find_url(episode_id)
|
104
|
+
# find_url(1234)
|
105
|
+
# param (hash params):
|
106
|
+
# find_url(episode_id: 1234)
|
87
107
|
# output: url string
|
88
|
-
def find_url(options
|
89
|
-
find_path_with_params(options).url
|
108
|
+
def find_url(*options)
|
109
|
+
find_path_with_params(*options).url
|
90
110
|
end
|
91
111
|
|
92
112
|
private
|
@@ -107,16 +127,16 @@ class ThetvdbApi::Episode < ThetvdbApi::Base
|
|
107
127
|
':apikey/series/:series_id/:order/:season/:episode/:language.xml'
|
108
128
|
end
|
109
129
|
|
110
|
-
def find_by_absolute_order_path_with_params(options)
|
111
|
-
path(find_by_absolute_order_path).params(api_key_with_language_options.merge(options))
|
130
|
+
def find_by_absolute_order_path_with_params(*options)
|
131
|
+
path(find_by_absolute_order_path).params(api_key_with_language_options.merge(normalize_series_id_absolute_options(*options)))
|
112
132
|
end
|
113
133
|
|
114
134
|
def find_by_absolute_order_path
|
115
135
|
':apikey/series/:series_id/absolute/:absolute/:language.xml'
|
116
136
|
end
|
117
137
|
|
118
|
-
def find_path_with_params(options)
|
119
|
-
path(find_path).params(api_key_with_language_options.merge(options))
|
138
|
+
def find_path_with_params(*options)
|
139
|
+
path(find_path).params(api_key_with_language_options.merge(normalize_episode_id_options(*options)))
|
120
140
|
end
|
121
141
|
|
122
142
|
def find_path
|