scrobbler-ng 2.0.6 → 2.0.7

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.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 6
3
2
  :major: 2
4
- :build:
5
3
  :minor: 0
4
+ :patch: 7
5
+ :build:
@@ -34,6 +34,10 @@ module Scrobbler
34
34
  raise ArgumentError unless data.kind_of?(Hash)
35
35
  super(data)
36
36
 
37
+ if @artist.is_a?(String) then
38
+ @artist = Artist.new(:name => @artist)
39
+ end
40
+
37
41
  raise ArgumentError, "Artist or mbid is required" if @artist.nil? && @mbid.nil?
38
42
  raise ArgumentError, "Name is required" if @name.empty?
39
43
  end
@@ -74,8 +78,7 @@ module Scrobbler
74
78
  next unless tag.name == 'tag'
75
79
  @top_tags << Tag.new_from_libxml(tag)
76
80
  end
77
- when 'wiki'
78
- # @todo Handle wiki entries
81
+ when 'wiki' # @todo Handle wiki entries
79
82
  when 'text'
80
83
  # ignore, these are only blanks
81
84
  when '#text'
@@ -107,7 +110,7 @@ module Scrobbler
107
110
  # @todo Add language code for wiki translation
108
111
  def load_info
109
112
  return nil if @info_loaded
110
- xml = Base.request('album.getinfo', {:artist => @artist, :album => @name})
113
+ xml = Base.request('album.getinfo', {:artist => @artist.name, :album => @name})
111
114
  unless xml.root['status'] == 'failed'
112
115
  xml.root.children.each do |childL1|
113
116
  next unless childL1.name == 'album'
@@ -91,12 +91,14 @@ module Scrobbler
91
91
  # @param [Hash] parameters The parameters passed as URL params.
92
92
  # @return [String]
93
93
  def Base.load_from_cache(parameters)
94
+ found = nil
94
95
  @@cache.each do |cache|
95
96
  if cache.has?(parameters)
96
- return cache.get(parameters)
97
+ found = cache.get(parameters)
98
+ break
97
99
  end
98
100
  end
99
- nil
101
+ found
100
102
  end
101
103
 
102
104
  # Save a request answer to all caches that would store it.
data/scrobbler-ng.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{scrobbler-ng}
8
- s.version = "2.0.6"
8
+ s.version = "2.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Nunemaker", "Jonathan Rudenberg", "Uwe L. Korn"]
12
- s.date = %q{2010-08-05}
12
+ s.date = %q{2010-08-11}
13
13
  s.description = %q{A ruby library for accessing the Last.fm 2.0 API. It is higly optimized so that it uses less memory and parses XML (through Nokogiri) than other implementations.}
14
14
  s.email = %q{uwelk@xhochy.org}
15
15
  s.extra_rdoc_files = [
@@ -8,7 +8,7 @@ describe Scrobbler::Album do
8
8
  end
9
9
 
10
10
  it 'should know the artist' do
11
- @album.artist.should eql('Carrie Underwood')
11
+ @album.artist.name.should eql('Carrie Underwood')
12
12
  end
13
13
 
14
14
  it "should know it's name" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrobbler-ng
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 6
10
- version: 2.0.6
9
+ - 7
10
+ version: 2.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Nunemaker
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-08-05 00:00:00 +02:00
20
+ date: 2010-08-11 00:00:00 +02:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency