tvdb_party 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/tvdb_party/search.rb +2 -4
- data/test/tvdb_party_test.rb +11 -0
- data/tvdb_party.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/lib/tvdb_party/search.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
module TvdbParty
|
2
2
|
class Search
|
3
3
|
include HTTParty
|
4
|
-
|
4
|
+
include HTTParty::Icebox
|
5
5
|
attr_accessor :language
|
6
|
-
|
7
|
-
# cache :store => 'file', :timeout => 120, :location => Dir.tmpdir
|
6
|
+
cache :store => 'file', :timeout => 120, :location => Dir.tmpdir
|
8
7
|
|
9
8
|
base_uri 'www.thetvdb.com/api'
|
10
9
|
|
@@ -38,7 +37,6 @@ module TvdbParty
|
|
38
37
|
|
39
38
|
def get_episode(series, season_number, episode_number, language = self.language)
|
40
39
|
response = self.class.get("/#{@api_key}/series/#{series.id}/default/#{season_number}/#{episode_number}/#{language}.xml").parsed_response
|
41
|
-
puts response.inspect
|
42
40
|
if response["Data"] && response["Data"]["Episode"]
|
43
41
|
Episode.new(response["Data"]["Episode"])
|
44
42
|
else
|
data/test/tvdb_party_test.rb
CHANGED
@@ -17,6 +17,17 @@ class TvdbPartyTest < Test::Unit::TestCase
|
|
17
17
|
|
18
18
|
end
|
19
19
|
|
20
|
+
context "search for episode that doesn't exist" do
|
21
|
+
setup do
|
22
|
+
@show = @tvdb.get_series_by_id(75700)
|
23
|
+
end
|
24
|
+
|
25
|
+
should "have handle 404 on episode query" do
|
26
|
+
assert_equal nil, @show.get_episode(1, 17)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
20
31
|
context "search for real show" do
|
21
32
|
setup do
|
22
33
|
@results = @tvdb.search("The Office US")
|
data/tvdb_party.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tvdb_party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jon Maddox
|