Permalink
Browse files

Handle songs without Album art

  • Loading branch information...
1 parent 167375b commit e331633e35098b4cd2050c34893c0ad8b12bdee7 @ErebusBat committed Dec 28, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 update_itunes_cache.rb
@@ -1,10 +1,18 @@
#!/usr/bin/env ruby
require 'yaml'
+require 'FileUtils'
cache_file_path='/tmp/.itunes-current-track'
cache_file=File.open(cache_file_path, 'r') { |f| YAML.load(f.read) } if File.exists? cache_file_path
def update_album_artwork
artwork_script=File.join(File.dirname(__FILE__), 'tools/iTunesArtwork.scpt')
+ # Due to errors
+ img_root_path = '/Users/aburns/Pictures/iTunes Artwork'
+
+ # Due to the way the apple script works, and the fact that AS sucks balls
+ # we handle copying the 'default/no art' image over. The AS will overwrite it if it exists
+ FileUtils.cp File.join(img_root_path, 'Default/fancy-none.png'), File.join(img_root_path, 'albumArt.png')
+
`osascript "#{artwork_script}"` if File.exists?(artwork_script)
end

0 comments on commit e331633

Please sign in to comment.