Skip to content

Commit

Permalink
Handle songs without Album art
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Burns committed Dec 28, 2011
1 parent 167375b commit e331633
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 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

Expand Down

0 comments on commit e331633

Please sign in to comment.