musicbrainz 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.9
1
+ 0.4.10
@@ -1,12 +1,12 @@
1
1
  module MusicBrainz
2
2
  class Release
3
- attr_accessor :id, :title, :status, :date, :country
3
+ attr_accessor :id, :title, :status, :format, :date, :country
4
4
  @tracks
5
5
 
6
6
  def tracks
7
7
  if @tracks.nil? and not self.id.nil?
8
8
  @tracks = []
9
- Nokogiri::XML(MusicBrainz.load('http://musicbrainz.org/ws/2/release/' + self.id + '?inc=recordings&limit=100')).css('medium-list > medium > track-list > track').each do |r|
9
+ Nokogiri::XML(MusicBrainz.load('http://musicbrainz.org/ws/2/release/' + self.id + '?inc=recordings+media&limit=100')).css('medium-list > medium > track-list > track').each do |r|
10
10
  @tracks << MusicBrainz::Track.parse_xml(r)
11
11
  end
12
12
  end
@@ -14,7 +14,7 @@ module MusicBrainz
14
14
  end
15
15
 
16
16
  def self.find mbid
17
- xml = Nokogiri::XML(MusicBrainz.load('http://musicbrainz.org/ws/2/release/' + mbid)).css('release').first
17
+ xml = Nokogiri::XML(MusicBrainz.load('http://musicbrainz.org/ws/2/release/' + mbid + '?inc=media')).css('release').first
18
18
  self.parse_xml(xml) unless xml.nil?
19
19
  end
20
20
 
@@ -23,6 +23,7 @@ module MusicBrainz
23
23
  @release.id = xml.attr('id')
24
24
  @release.title = xml.css('title').text unless xml.css('title').empty?
25
25
  @release.status = xml.css('status').text unless xml.css('status').empty?
26
+ @release.format = xml.css('medium-list > medium > format').first.text unless xml.css('medium-list > medium > format').empty?
26
27
  date = xml.css('date').empty? ? '2030-12-31' : xml.css('date').text
27
28
  if date.length == 0
28
29
  date = '2030-12-31'
@@ -6,7 +6,7 @@ module MusicBrainz
6
6
  def releases
7
7
  if @releases.nil? and not self.id.nil?
8
8
  @releases = []
9
- Nokogiri::XML(MusicBrainz.load('http://musicbrainz.org/ws/2/release/?release-group=' + self.id + '&limit=100')).css('release').each do |r|
9
+ Nokogiri::XML(MusicBrainz.load('http://musicbrainz.org/ws/2/release/?release-group=' + self.id + '&inc=media&limit=100')).css('release').each do |r|
10
10
  @releases << MusicBrainz::Release.parse_xml(r)
11
11
  end
12
12
  end
data/musicbrainz.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{musicbrainz}
8
- s.version = "0.4.9"
8
+ s.version = "0.4.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gregory Eremin"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: musicbrainz
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.9
5
+ version: 0.4.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - Gregory Eremin
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - ">="
122
122
  - !ruby/object:Gem::Version
123
- hash: -3831008617667218199
123
+ hash: -804216001345752924
124
124
  segments:
125
125
  - 0
126
126
  version: "0"