Compare commits

..

No commits in common. "d3b5d86bca2392e4f3f40bcef315e76eb900c83e" and "f11970fee30ebaae38297a7da71505052c9a5ff0" have entirely different histories.

View File

@ -5,41 +5,29 @@ BASE = "/pegasus/pub/music/artists"
DEST = "/media/josh/JoshMusic"
ARTISTS = <<EOF
A Perfect Circle
All That Remains
#Avenged Sevenfold
Avenged Sevenfold
Collective Soul
Dave Matthews Band
Days Of The New
#DevilDriver
#Falling in Reverse
Eluveitie
DevilDriver
Falling in Reverse
Fear Factory
Fuel
#Godsmack
Hans Zimmer
Godsmack
Incubus
Lamb of God
London Symphony Orchestra
#Machine Head
Matchbox Twenty
Machine Head
Mudvayne
Our Lady Peace
POD
Ra
Rush
#Staind
#Static-X
#System of a Down
Staind
Static-X
System of a Down
Tantric
Taproot
The Goo Goo Dolls
The Offspring
#Tool
Tool
Trans-Siberian Orchestra
Trivium
Volbeat
Weezer
EOF
EXCLUDE = <<EOF.split("\n").map(&:chomp)
@ -48,29 +36,18 @@ EOF
require "fileutils"
artists = ARTISTS.lines.map do |artist|
if artist !~ /#/
artist.chomp
end
end.compact
if ARGV[0] == "-s"
cmd = %w[du -shc] + artists.map {|a| "#{BASE}/#{a}"}
system(*cmd)
exit 0
end
unless Dir.exist?(DEST)
$stderr.puts "#{DEST} does not exist"
end
artists.each do |artist|
ARTISTS.lines.each do |artist|
artist = artist.chomp
Dir.glob("#{BASE}/#{artist}/*").sort.each do |album_dir|
next if album_dir.split("/").any? {|part| EXCLUDE.include?(part)}
album = File.basename(album_dir)
mp3_files = Dir.glob("#{album_dir}/*.mp3").sort
dest = "#{DEST}/#{artist}/#{album}"
puts "Creating #{dest}" unless Dir.exist?(dest)
puts "Creating #{dest}"
FileUtils.mkdir_p(dest)
mp3_files.each do |mp3_file|
unless File.exist?("#{dest}/#{File.basename(mp3_file)}")