Parsing discogs better
This commit is contained in:
+5
-2
@@ -144,7 +144,10 @@ class Discogs
|
||||
if split == 2
|
||||
break
|
||||
end
|
||||
if _.attr('class').match(/^main.*/) and _.css('td')[3].text.scan(/\d/).join('') != '' and _.css('a.mr_toggler').length == 1
|
||||
if _.attr('class').match(/^main.*/) and _.css('td')[3].text.scan(/\d/).join('') != '' and (
|
||||
_.css('a.mr_toggler').length == 1 or
|
||||
_.css('td')[1].text.match(/\(.*?Album.*?\)/).present?
|
||||
)
|
||||
albums << {
|
||||
:uri => (_.attr('class').match(/master/) ? 'master/' : 'release/')+_.attr('id')[1,100],
|
||||
:title => _.css('h4 > a').first.text,
|
||||
@@ -152,7 +155,7 @@ class Discogs
|
||||
}
|
||||
end
|
||||
end
|
||||
albums
|
||||
ap albums
|
||||
end
|
||||
|
||||
def self.search_for_artist name
|
||||
|
||||
Reference in New Issue
Block a user