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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -15
  3. data/CHANGELOG.md +53 -0
  4. data/README.md +80 -103
  5. data/lib/thetvdb_api/actor.rb +18 -11
  6. data/lib/thetvdb_api/banner.rb +18 -11
  7. data/lib/thetvdb_api/base.rb +24 -0
  8. data/lib/thetvdb_api/episode.rb +68 -48
  9. data/lib/thetvdb_api/search.rb +85 -28
  10. data/lib/thetvdb_api/series.rb +36 -22
  11. data/lib/thetvdb_api/update.rb +8 -4
  12. data/lib/thetvdb_api/version.rb +1 -1
  13. data/spec/functionals/actor_spec.rb +26 -6
  14. data/spec/functionals/banner_spec.rb +26 -6
  15. data/spec/functionals/base_spec.rb +79 -0
  16. data/spec/functionals/episode_spec.rb +120 -28
  17. data/spec/functionals/search_spec.rb +143 -25
  18. data/spec/functionals/series_spec.rb +54 -14
  19. data/spec/functionals/update_spec.rb +12 -12
  20. data/spec/integrations/actor_spec.rb +14 -0
  21. data/spec/integrations/banner_spec.rb +14 -0
  22. data/spec/integrations/client_spec.rb +150 -0
  23. data/spec/integrations/episode_spec.rb +43 -0
  24. data/spec/integrations/search_spec.rb +41 -0
  25. data/spec/integrations/series_spec.rb +23 -0
  26. data/spec/integrations/update_spec.rb +32 -0
  27. data/spec/spec_helper.rb +1 -4
  28. data/spec/support/.keep +0 -0
  29. data/spec/support/api_key.rb.example +1 -0
  30. data/thetvdb_api.gemspec +2 -2
  31. metadata +29 -24
  32. data/spec/integrations/classes/actor_spec.rb +0 -13
  33. data/spec/integrations/classes/banner_spec.rb +0 -13
  34. data/spec/integrations/classes/client_spec.rb +0 -109
  35. data/spec/integrations/classes/episode_spec.rb +0 -31
  36. data/spec/integrations/classes/search_spec.rb +0 -31
  37. data/spec/integrations/classes/series_spec.rb +0 -19
  38. data/spec/integrations/classes/update_spec.rb +0 -31
  39. data/spec/integrations/integration_spec_helper.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97791a043434b43dfd16cf2edc9e37a67315cb79
4
- data.tar.gz: 3a7bb165e31c4bbc6d0ae4c97ef948bfc2f84282
3
+ metadata.gz: 4a80e13185840b4ed5e40060728b17b84ff3c645
4
+ data.tar.gz: bebfb5dc9fd816cddf862621474217e426bb7984
5
5
  SHA512:
6
- metadata.gz: 78dfd626d8f116d3bbc52b64d4100e6fec6ff844a7ce408271625fef346bdb7f20856d3e041a3eada81e9d64d6f224b6372f66204a539c5c97f3f00c7e2aa949
7
- data.tar.gz: 7980189c25c89468d433e8d885c45c566c6dcb3f57c07723bf2731699181c5030f732f1884026c4a254687e57725185f6a6fa681a230aee163abe69ec5ddfa6f
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/integrations/support/configuration.rb
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
- ## Getting started
11
+ ## Installation
12
12
 
13
- You can add it to your Gemfile with:
13
+ With Bundler:
14
14
 
15
15
  ```ruby
16
16
  gem 'thetvdb_api'
17
17
  ```
18
18
 
19
- Run the bundle command to install it.
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 way (create client class, one entry point)
26
-
27
- * II way (direct access to api class, many entry points)
33
+ * I case (create client class, one entry point)
28
34
 
29
- Search series (by name) methods - access by search method or Search class
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.search.get_series(options = {})
34
- client.search.get_series_url(options = {}) # return only full url
35
- client.search.get_series_by_remote_id(options = {})
36
- client.search.get_series_by_remote_id_url(options = {}) # return only full url
37
- client.search.get_episode(options = {})
38
- client.search.get_episode_url(options = {}) # return only full url
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
- ```ruby
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
- Search series (by id) methods - access by series method or Series class
49
+ Language attribute is required
52
50
 
53
51
  ```ruby
54
- client = ThetvdbApi::Client.new(api_key: '...', language: 'en')
55
- client.series.find(options = {})
56
- client.series.find_url(options = {}) # return only full url
57
- client.series.find_full(options = {})
58
- client.series.find_full_url(options = {}) # return only full url
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
- ```ruby
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
- Return series actors - access by actor method or Actor class
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
- ```ruby
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
- ```ruby
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
- Return series banners - access by banner method or Banner class
68
+ * all
69
+ * all_url
84
70
 
85
- ```ruby
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
- ```ruby
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
- Return series episode - access by episode method or Episode class
75
+ * all
76
+ * all_url
98
77
 
99
- ```ruby
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
- ```ruby
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
- Get updates - access by update method or Update class
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
- ```ruby
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
- ```ruby
138
- update = ThetvdbApi::Update.new(api_key: '...', language: 'en')
139
- update.day
140
- update.day_url # return only full url
141
- update.week
142
- update.week_url # return only full url
143
- update.month
144
- update.month_url # return only full url
145
- update.all
146
- update.all_url # return only full url
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
 
@@ -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: options hash
6
- # series_id: TV series name
7
- # output: XML string (example: http://thetvdb.com/wiki/index.php/API:actors.xml)
8
- def find(options = {})
9
- find_path_with_params(options).get
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: options hash
16
- # series_id: TV series name
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
@@ -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: options hash
6
- # series_id: TV series name
7
- # output: XML string (example: http://thetvdb.com/wiki/index.php/API:banners.xml)
8
- def find(options = {})
9
- find_path_with_params(options).get
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: options hash
16
- # series_id: TV series name
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
@@ -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
@@ -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: options hash
6
- # series_id: TV series ID
7
- # season: season number
8
- # episode: episode number in season
9
- # output: XML string (example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record)
10
- def find_by_default_order(options = {})
11
- find_by_order(options.merge(order: 'default'))
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: options hash
18
- # series_id: TV series ID
19
- # season: season number
20
- # episode: episode number in season
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: options hash
30
- # series_id: TV series ID
31
- # season: season number
32
- # episode: episode number in season
33
- # output: XML string (example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record)
34
- def find_by_dvd_order(options = {})
35
- find_by_order(options.merge(order: 'dvd'))
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
- # series_id: TV series ID
43
- # season: season number
44
- # episode: episode number in season
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: options hash
54
- # series_id: TV series ID
55
- # absolute: absolute number in series
56
- # output: XML string (example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record)
57
- def find_by_absolute_order(options = {})
58
- find_by_absolute_order_path_with_params(options).get
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
- # series_id: TV series ID
66
- # absolute: absolute number in series
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: options hash
76
- # episode_id: TV episode ID
77
- # output: XML string (example: http://thetvdb.com/wiki/index.php/API:Base_Episode_Record)
78
- def find(options = {})
79
- find_path_with_params(options).get
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: options hash
86
- # episode_id: TV 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