Compare commits
2 Commits
f11970fee3
...
d3b5d86bca
Author | SHA1 | Date | |
---|---|---|---|
d3b5d86bca | |||
70b07abbae |
@ -5,29 +5,41 @@ BASE = "/pegasus/pub/music/artists"
|
|||||||
DEST = "/media/josh/JoshMusic"
|
DEST = "/media/josh/JoshMusic"
|
||||||
|
|
||||||
ARTISTS = <<EOF
|
ARTISTS = <<EOF
|
||||||
Avenged Sevenfold
|
A Perfect Circle
|
||||||
|
All That Remains
|
||||||
|
#Avenged Sevenfold
|
||||||
Collective Soul
|
Collective Soul
|
||||||
DevilDriver
|
Dave Matthews Band
|
||||||
Falling in Reverse
|
Days Of The New
|
||||||
|
#DevilDriver
|
||||||
|
#Falling in Reverse
|
||||||
|
Eluveitie
|
||||||
Fear Factory
|
Fear Factory
|
||||||
Fuel
|
Fuel
|
||||||
Godsmack
|
#Godsmack
|
||||||
|
Hans Zimmer
|
||||||
Incubus
|
Incubus
|
||||||
Lamb of God
|
Lamb of God
|
||||||
Machine Head
|
London Symphony Orchestra
|
||||||
|
#Machine Head
|
||||||
|
Matchbox Twenty
|
||||||
Mudvayne
|
Mudvayne
|
||||||
|
Our Lady Peace
|
||||||
POD
|
POD
|
||||||
Staind
|
Ra
|
||||||
Static-X
|
Rush
|
||||||
System of a Down
|
#Staind
|
||||||
|
#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)
|
||||||
@ -36,18 +48,29 @@ 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.lines.each do |artist|
|
artists.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}"
|
puts "Creating #{dest}" unless Dir.exist?(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