Gamingforce Interactive Forums
85242 35212

Go Back   Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk
Register FAQ GFWiki Community Donate Arcade ChocoJournal Calendar

Notices

Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis.
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).


Re-organizing folders from #gamemp3s releases
Reply
 
Thread Tools
Duminas
Something


Member 29

Level 13.21

Mar 2006


Reply With Quote
Old Nov 23, 2006, 04:59 AM Local time: Nov 23, 2006, 01:59 AM #1 of 6
Helps if I read.
As I assume slashes, colons, ampersands, and the like are not valid in Windows file/directory names, what do you use for special characters?

Super Metroid “Sound In Action” being an example here--I know double-quotes aren't valid in filenames, but I have very little experience with gamemp3s' rips and naming conventions. Trying to figure out how things are named in case of special characters so I can whip up a script for you.

Jam it back in, in the dark.


Need help using an FTP client? Look no further! ««

Last edited by Duminas; Nov 23, 2006 at 05:05 AM.
Duminas
Something


Member 29

Level 13.21

Mar 2006


Reply With Quote
Old Nov 23, 2006, 07:36 PM Local time: Nov 23, 2006, 04:36 PM #2 of 6
Alright, a couple things.

First, there's an archive attached--you need this, as it has two files. One has a list of all the albums (I extracted that with another script I forgot to save =\ ), and another is the Perl script itself; the script also expects that file to be with your albums, so drop it into the $source you'll be defining below.

I also did not test this much, but when I did, it was in the same directory as the empty album directories were. Also, there's a small edit you need to make to the third line of the script, which is (as in the archive):
Code:
$source      = '/home/duminas';
Change that to wherever the big album directory is. You may need to change it to something like C:\Music due to how Windows naming works.
The same applies to line 39, which is:
Code:
		`move "$source/$relinfo[1]" "$lastrelease/$relinfo[1]"`;
The forward-slashes may need to be changed to back-slashes.

Third, this will say it succeeded if it _FINDS_ the directory--it may fail to move it, due to some odd characters here and there (ampersands as an example). These you will need to deal with on your own.

Fourth, it changes the release dates from, say, 2006/11/14 to 2006-11-14. This is really minor, but just bringing it up. I'm also going to put the code straight away below for anyone who wishes to see it, but you'll need both.

You'll also need to install Perl if you want to use this. I'll help you with that if you need it.

I hope this works for you, Rock.

Code:
#!/usr/bin/perl
# Where is the current massive folder? No trailing slash.
$source	   = '/home/duminas';

if(!chdir($source)) {
	die("$! ($source)\n");
}

open(FILE, 'gamemp3s_albums.txt');
@list = <FILE>;
close(FILE);

my $lastrelease;
my @relinfo;
foreach $line ( @list ) {
	chomp($line);

	# Break it into an array at the three dashes.
	# First part will be the date, second is the name.
	@relinfo = split(/---/, $line);

	# New release?
	if($relinfo[0] ne $lastrelease) {
		$lastrelease = $relinfo[0]; $lr_dir = $lastrelease;
		
		$lr_dir =~ s/\//-/gi;
		# Try to make the album directory.
		if(!mkdir($lr_dir)){
			die("Failed to make directory! $! ($lr_dir)\n");
		}

		print "$lastrelease\n";
	}

	# Now print the album...
	# You MAY need to change the forward slashes here to a backslash.
	if( -d "$relinfo[1]") {
		# rename() is pretty crazy, so I'm using a move DOS call here.
		`move "$source/$relinfo[1]" "$lastrelease/$relinfo[1]"`;
		# `mv "$relinfo[1]" "$lr_dir/$relinfo[1]"`;
		print ": Moved album:\n\t";
	}
	else {
		print ": Could not find album to move:\n\t";
	}
	print "\t$relinfo[1]\n";
}


Most amazing jew boots
Attached Files
File Type: zip gmp3s_sorter.zip (11.4 KB, 1 views)


Need help using an FTP client? Look no further! ««

Last edited by Duminas; Nov 23, 2006 at 07:41 PM.
Reply


Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk > Re-organizing folders from #gamemp3s releases

Forum Jump


All times are GMT -5. The time now is 08:28 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2026, vBulletin Solutions, Inc.