rjl-allmusic 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/allmusic.rb +7 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 787431b076c2ee822666ea04063ce6b8cda6c27f
4
- data.tar.gz: c739491f05b3407a9ee54a7b0fa76dd0a6dbd501
3
+ metadata.gz: 487a2bf95656ac5ed74fd17e7bf80ae0292ff37f
4
+ data.tar.gz: 53f97002dac3f8e78e090a9038190a0062535b1f
5
5
  SHA512:
6
- metadata.gz: ea7d62c96dae2e47f7a88a6ec58458decea7aa7565cfa039bd6448a50d9739f0c1323a9f97201444dd3512385cf1bac5a65f7ca190faf43721667a5c89765d38
7
- data.tar.gz: 557d55e82be8b31d40194b9b7cb6517a30f60ccfd188cd790e6156b4cf6355775893a5c4d4bb1b631e957eafd26267b1bd9edb4919f5ed021610ac6516ee3033
6
+ metadata.gz: 49e286ca30e36a89a8ce9a705edafed503e91e3dcbd48adaab8ac071c034c03bcb78fc1bbc33652a723fc1e44f7c107881a3c1d07920988d175472a220e17974
7
+ data.tar.gz: ce17ad2d46b829ee25c3241b43de609cb7217c287aaf9df08da30cc8abf120fa6f1893d9bb574fa991978b018994537f455f8ed5728c03cbe7f0a25d6e2aff76
@@ -2,6 +2,10 @@ require 'nokogiri'
2
2
  require 'uri'
3
3
  require 'open-uri'
4
4
  require 'fuzzystringmatch' #https://github.com/kiyoka/fuzzy-string-match
5
+ require 'logger'
6
+
7
+ file = File.open('allmusic.log', File::CREAT)
8
+ $log = Logger.new( file )
5
9
 
6
10
  # Allmusic.com client
7
11
  # @param [String]
@@ -47,12 +51,11 @@ class Allmusic
47
51
  begin
48
52
  artist_search_page = Nokogiri::HTML(open(artist_search_url))
49
53
  rescue
50
- return
54
+ return metadata
51
55
  end
52
56
 
53
57
  if no_search_result?(artist_search_page)
54
- # raise "Couldn't find artist '#{@artist}'"
55
- return
58
+ return metadata
56
59
  end
57
60
 
58
61
  # get the url of the artist page
@@ -74,7 +77,7 @@ class Allmusic
74
77
  metadata[:genres] = parse( album_page, 'genre' )
75
78
  metadata[:styles] = parse( album_page, 'styles')
76
79
  rescue
77
- puts ">> ERROR: Couldn't open #{album_url} for #{artist} / #{album}"
80
+ return metadata
78
81
  end
79
82
  end
80
83
  return metadata
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjl-allmusic
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Lyon