Compare commits
No commits in common. "d3b5d86bca2392e4f3f40bcef315e76eb900c83e" and "f11970fee30ebaae38297a7da71505052c9a5ff0" have entirely different histories.
d3b5d86bca
...
f11970fee3
@ -5,41 +5,29 @@ BASE = "/pegasus/pub/music/artists"
|
|||||||
DEST = "/media/josh/JoshMusic"
|
DEST = "/media/josh/JoshMusic"
|
||||||
|
|
||||||
ARTISTS = <<EOF
|
ARTISTS = <<EOF
|
||||||
A Perfect Circle
|
Avenged Sevenfold
|
||||||
All That Remains
|
|
||||||
#Avenged Sevenfold
|
|
||||||
Collective Soul
|
Collective Soul
|
||||||
Dave Matthews Band
|
DevilDriver
|
||||||
Days Of The New
|
Falling in Reverse
|
||||||
#DevilDriver
|
|
||||||
#Falling in Reverse
|
|
||||||
Eluveitie
|
|
||||||
Fear Factory
|
Fear Factory
|
||||||
Fuel
|
Fuel
|
||||||
#Godsmack
|
Godsmack
|
||||||
Hans Zimmer
|
|
||||||
Incubus
|
Incubus
|
||||||
Lamb of God
|
Lamb of God
|
||||||
London Symphony Orchestra
|
Machine Head
|
||||||
#Machine Head
|
|
||||||
Matchbox Twenty
|
|
||||||
Mudvayne
|
Mudvayne
|
||||||
Our Lady Peace
|
|
||||||
POD
|
POD
|
||||||
Ra
|
Staind
|
||||||
Rush
|
Static-X
|
||||||
#Staind
|
System of a Down
|
||||||
#Static-X
|
|
||||||
#System of a Down
|
|
||||||
Tantric
|
Tantric
|
||||||
Taproot
|
Taproot
|
||||||
The Goo Goo Dolls
|
The Goo Goo Dolls
|
||||||
The Offspring
|
The Offspring
|
||||||
#Tool
|
Tool
|
||||||
Trans-Siberian Orchestra
|
Trans-Siberian Orchestra
|
||||||
Trivium
|
Trivium
|
||||||
Volbeat
|
Volbeat
|
||||||
Weezer
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
EXCLUDE = <<EOF.split("\n").map(&:chomp)
|
EXCLUDE = <<EOF.split("\n").map(&:chomp)
|
||||||
@ -48,29 +36,18 @@ EOF
|
|||||||
|
|
||||||
require "fileutils"
|
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)
|
unless Dir.exist?(DEST)
|
||||||
$stderr.puts "#{DEST} does not exist"
|
$stderr.puts "#{DEST} does not exist"
|
||||||
end
|
end
|
||||||
|
|
||||||
artists.each do |artist|
|
ARTISTS.lines.each do |artist|
|
||||||
|
artist = artist.chomp
|
||||||
Dir.glob("#{BASE}/#{artist}/*").sort.each do |album_dir|
|
Dir.glob("#{BASE}/#{artist}/*").sort.each do |album_dir|
|
||||||
next if album_dir.split("/").any? {|part| EXCLUDE.include?(part)}
|
next if album_dir.split("/").any? {|part| EXCLUDE.include?(part)}
|
||||||
album = File.basename(album_dir)
|
album = File.basename(album_dir)
|
||||||
mp3_files = Dir.glob("#{album_dir}/*.mp3").sort
|
mp3_files = Dir.glob("#{album_dir}/*.mp3").sort
|
||||||
dest = "#{DEST}/#{artist}/#{album}"
|
dest = "#{DEST}/#{artist}/#{album}"
|
||||||
puts "Creating #{dest}" unless Dir.exist?(dest)
|
puts "Creating #{dest}"
|
||||||
FileUtils.mkdir_p(dest)
|
FileUtils.mkdir_p(dest)
|
||||||
mp3_files.each do |mp3_file|
|
mp3_files.each do |mp3_file|
|
||||||
unless File.exist?("#{dest}/#{File.basename(mp3_file)}")
|
unless File.exist?("#{dest}/#{File.basename(mp3_file)}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user