musicfix

music file renamer and tagger
git clone git://git.2f30.org/musicfix.git
Log | Files | Refs | README | LICENSE

commit c8091b445686e47a3bb21e2bebecb6c146af5346
parent 914d88bd1e51e39d6ddfc45fb6cb0ed27e2a3bd8
Author: lostd <lostd@2f30.org>
Date:   Sun Sep  7 13:39:29 +0100

Adapt to the new API changes for releases and fix image URIs

Diffstat:
bin/musicfix | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/bin/musicfix b/bin/musicfix @@ -73,7 +73,7 @@ def getimgurl rel return nil unless rel['images'] img = rel['images'].select {|i| i['type'] == 'primary'}.first || rel['images'].first - img['uri'].gsub 'api.discogs.com', 's.pixogs.com' + img['uri'].gsub 'api.discogs.com/images/R-90', 's.pixogs.com/image/R' end # Construct position list from tracks filter @@ -297,11 +297,11 @@ elsif cmd == 'tags' then else # Get release data from Discogs STDERR.puts "Getting release data from Discogs..." - r = YAML.load(open("http://api.discogs.com/release/#{relid}?f=json", - Headers))['resp']['release'] + r = YAML.load(open("http://api.discogs.com/releases/#{relid}", + Headers)) mr = if r['master_id'] then - YAML.load(open("http://api.discogs.com/master/#{r['master_id']}?f=json", - Headers))['resp']['master'] + YAML.load(open("http://api.discogs.com/masters/#{r['master_id']}", + Headers)) end # Tracklist can contain dummy header tracks, strip them tl = r['tracklist'].select {|t| t['position'] != ''}