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 +1 -1
- data/lib/models/music_brainz/release.rb +4 -3
- data/lib/models/music_brainz/release_group.rb +1 -1
- data/musicbrainz.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
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
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: musicbrainz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
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: -
|
123
|
+
hash: -804216001345752924
|
124
124
|
segments:
|
125
125
|
- 0
|
126
126
|
version: "0"
|