Gamingforce Interactive Forums
85242 35212

Go Back   Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk

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
Rock
Rock me


Member 66

Level 29.37

Mar 2006


Reply With Quote
Old Nov 21, 2006, 07:41 AM Local time: Nov 21, 2006, 02:41 PM #1 of 6
Re-organizing folders from #gamemp3s releases

What I need to do is the following:

Organize my #gamemp3s music so they match their original folder scheme (i.e. 2006-11-3/folders/).

Right now I have all the seperate albums in a single folder, but just displaying its contents takes ages with 400+ subfolders. So I want to seperate the albums back into their original release date (year-month-day) folders.

Needless to say, I can't do this manually, since it would take forever. I need some sort of script/macro that takes information from the #gamemp3s release history and organizes my folders accordingly. All subfolders (album names) are untouched, so this should work out well.

Any suggestions on how to get started?

Jam it back in, in the dark.
Rock
Rock me


Member 66

Level 29.37

Mar 2006


Reply With Quote
Old Nov 22, 2006, 03:34 PM Local time: Nov 22, 2006, 10:34 PM #2 of 6
Anyone, please.

This can't be an impossible task. I do have some experience with VisualBasic scripting, but I just need some pointers on this. At least I think VB would be a good way of getting something like this done.

There's nowhere I can't reach.
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 #3 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.

This thing is sticky, and I don't like it. I don't appreciate it.


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

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


Member 66

Level 29.37

Mar 2006


Reply With Quote
Old Nov 23, 2006, 06:04 AM Local time: Nov 23, 2006, 01:04 PM #4 of 6
The actual folder for Super Metroid "Sound in Action" has normal quotes in it.

Still, I don't want to rename these folders, but rather have them moved to their respective YEAR-MONTH-DAY\ subfolder, so all I need to do is compare my folder names from that release list and put them in the right subfolder. All of them are currently in the same folder.

If there are some special characters that can't be read, I might as well sort those folders out manually.

Thanks a lot for your reply, any help is greatly appreciated.

I am a dolphin, do you want me on your body?
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 #5 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.
Sir VG
Banned


Member 49

Level 25.67

Mar 2006


Reply With Quote
Old Nov 23, 2006, 11:43 PM Local time: Nov 23, 2006, 10:43 PM #6 of 6
Another method that could be used is using a program called ClrMamePro. If you (or somebody else) builds a database and then runs your files through it, it'll sort everything on its own. It confirms a file is a match via CRC codes and can fix file and folder names if necessary.

I've thought about doing something like this at some point, but I haven't done so yet. I'm still learning about the program for making databases. I might try fooling around with it some more later.

What kind of toxic man-thing is happening now?
Reply

Thread Tools

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 10:09 AM.


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