Help - Search - Members - Calendar
Full Version: Create md5's for albums
Hydrogenaudio Forums > Misc. > Off-Topic
simonh
I have a load of albums that I'd like to md5. I've added replaygain, so they all need updating. Does anyone know of a program or script that can do this for me?

What I'd like is for each directory (album) to be given a filename for the md5 like this

'Depeche Mode - The Best Of.md5'

and stored in the directory with the mp3's. I'd like it to keep doing this until all directories are done. What I don't want is one md5 file for all albums. It must also overwrite the existing md5

cheers for any help.
smok3
abstract;

i would do a batch that expects directory list as input, like:
c:\folder1
c:\folder2
d:\folder3

then you would do a loop for each input and do something like:

loop
cd foldernameVAR
del *.md5
md5sum *.* > c:\tempsum.md5
move c:\tempsum.md5 to foldernameVAR\foldernameVAR.md5
del c:\tempsum.md5
end loop

i you don't find a solution soon, ill try to write something, let me know.
Synthetic Soul
I have a batch file that I think suits your needs. It uses FSUM to create the MD5 (although it could be easily amended to use another application). You would need to download FSUM, and edit the second line in the batch file to reference your actual path to FSUM. To run, just drop the root folder onto the batch file icon, and it will create an MD5 for every folder inside that folder, named the same as the parent folder.

CODE
@ECHO OFF

SET pathToFSUM="C:\Program File\FSUM\FSUM.EXE"

PUSHD %1
FOR /D /r %%G IN (*.*) DO CALL :ProcessFolder "%%G"
POPD

PAUSE
GOTO :EOF

:ProcessFolder
CALL :MakePath "%~1" "#-1#" parentFolder
PUSHD %1
%pathToFsum% -d%1 -jm *.* >"%temp%\%parentFolder%.md5"
MOVE /Y "%temp%\%parentFolder%.md5" %1
POPD
GOTO :EOF

:MakePath
FOR /F "tokens=1-7 delims=\" %%G IN ("%~1") DO CALL :SplitPath "%~1" %2 %3 "%%G" "%%H" "%%I" "%%J" "%%K" "%%L" "%%M"
GOTO:EOF

:SplitPath
SET p0=%~1
Set fullPath=%~2
SHIFT
IF [%3] NEQ [""] SET p1=%~3& SET /A max=1
IF [%4] NEQ [""] SET p2=%~4& SET /A max=2
IF [%5] NEQ [""] SET p3=%~5& SET /A max=3
IF [%6] NEQ [""] SET p4=%~6& SET /A max=4
IF [%7] NEQ [""] SET p5=%~7& SET /A max=5
IF [%8] NEQ [""] SET p6=%~8& SET /A max=6
IF [%9] NEQ [""] SET p7=%~9& SET /A max=7

FOR /L %%G IN (1,1,7) DO CALL :SetReverseVar %%G

FOR /L %%G IN (-7,1,7) DO CALL :ReplaceTokens %%G

SET %2=%fullPath%
GOTO:EOF

:SetReverseVar
IF [%max%] LEQ [0] GOTO:EOF
CALL SET p-%1=%%p%max%%%
SET /A max-=1
GOTO:EOF

:ReplaceTokens
CALL SET token=%%p%1%%
CALL SET fullPath=%%fullPath:#%1#=%token%%%
GOTO:EOF

FYI: Most of the code (90%) is there to work out what the parent folder is called. If anyone has a better method I'd be interested to know. I first developed this code for this batch file.

Edit: Added /Y to MOVE command to comply with OP's requirement for MD5 to be overwritten.
simonh
Thanks for the replies. I found a program called fastsum, which does exactly what I was after (except for deleting the original md5's). Also forgot to mention that I'm using linux at the moment and it works fine with wine.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.