Skip to main content

Topic: Organizing old files (Read 10124 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
Organizing old files
Before I begin the huge task of reconverting to lossless, I still have my old mpc file folder in complete disarray. I'm having trouble getting the the correct taglines http://help.mp3tag.de/main_tags.html. I've been using Mp3tag with varying results. All I want is to have them all neat and organized with a m3u playlist in each folder. Here's how I want all my files folders to look like.

[1978] Van Halen
          1 Running With The Devil
          2 Eruption
          3 etc
          generate m3u playlist
[1979] Van Halen II
          1 You're no Good
          2 Dance The Night Away
          3 etc
          generate m3u playlist

And so on
Thanks.

  • mjb2006
  • [*][*][*][*][*]
Organizing old files
Reply #1
Mp3Tag can't generate .m3u files for you. You can do that from foobar2000 though.

To rename them and put them in folders, first get them all to a point where they have correct tags with the pieces of info you need: year, album title, track, title. Then select them all (Ctrl+A), and press Alt+1 or use the menus to go to Convert > Tag - Filename. For the format string, you'll want something like this:

Code: [Select]
'['%year%']' %album%\%track% %title%

Make sure the preview looks right, and if you're happy with it, click OK. It will create the folders and move/rename the files. If there's a problem, press Ctrl-Z immediately to undo the changes.


You can get fancier if you want. Like if you want to preface track numbers with a disc number and dash only when a disc number tag exists, and you want to have all your tracks numbered 1 through 9 to be written 01 through 09, then replace %track% in the above code with this:

Code: [Select]
[%discnumber%-]$ifgreater(%track%,0,$num(%track%,2),%track%)

Organizing old files
Reply #2
All the metadata is correct. I want foobar to correct the tags not convert the file to something else though. I went ctrl a, right clicked, convert, went down to properties, destination, and put the info you supplied, but gave me [] Van Halen\04 Ain't talkin about love.wav. It's almost there, but no year, no convert, and no m3u.

  • Mach-X
  • [*][*][*][*]
Organizing old files
Reply #3
I think he meant to use mp3tag to sort, and then foobar to generate the m3us.

  • Juha
  • [*][*][*][*][*]
Organizing old files
Reply #4
Hmm... long long time ago, I did prepare a VB script for to prepare the m3u files for my audio library.

All audio file paths are colected into a txt -file which then is read by script as input. Script scans all the folders given in input file and prepares the m3u files to selected location (current folder or each source folder).

A BATch file for to prepare the library structure and to call the Main script:

Code: [Select]
REM ---------------------------------------------
REM -----     M3U PLAYLIST MAKER v. 1.0     -----
REM ---------------------------------------------
REM
REM COPY THIS BATCH FILE AND SAVE AS name.BAT
REM
rem list all audio file types here
dir *.mp3 *.ape *.wma *.wav *.flac *.ogg *.m4a *.aif *.mka *.mpa *.mpc *.ofr *.tta *.sd2 *.aac *.mp4 *.mp2 *.vqf /S /B /OG >alltmp.txt
sort alltmp.txt >all.txt
cscript MakeM3U.vbs
del alltmp.txt

REM ----------------------------------------------


vb script:

Code: [Select]
' script starts ---------------------------------------------------------------------

Option Explicit

Dim objStream, objWrite
Dim strLine
Dim FSO
Dim toPath, toPathOpen, tmpPath
Dim strLength
Dim strAlbum, strArtist, whereTo
Dim plFileName
Dim posArtist, posAlbum

Const fName = "all.txt"
Const ForWriting = 2
Const TristateFalse = 0
Const TristateTrue = -1
Const TristateUseDefault = -2
Const ForReading = 1

whereTo = Left(UCase(InputBox("Do you want to place all created playlists into same folder (current) (Y/N) ?" & chr(10) & chr(10) & "Y = All playlists are located on folder the script is runned from" & chr(10) & "N = Playlist is located on Artist\Album\ -folder(s)")), 1)
select case whereTo
case "" 'cancel pressed
    WScript.Quit (0)
case else 'something inputted --> make it Y or N
    if whereTo <> "Y" and whereTo <> "N" then whereTo = "N"
end select

Set FSO = CreateObject("Scripting.FileSystemObject")

Set objStream = FSO.OpenTextFile(fName, ForReading, 1)
toPathOpen = "tmp"
plFileName = ""
toPath = ""
tmpPath = ""

Do While Not objStream.AtEndOfStream

    strLine = objStream.ReadLine
    strLength = Len(strLine)

    toPath = Left(strLine, InStrRev(strLine, "\", strLength, 1))

    posAlbum = InStrRev(toPath, "\", Len(toPath)-1, 1)+1
    posArtist = InStrRev(toPath, "\", posAlbum-2, 1)+1

    plFileName = Mid(toPath, posArtist, posAlbum-posArtist-1) & "-" & Mid(toPath, posAlbum, len(toPath) - posAlbum) & ".m3u"

    if strLength and (Len(toPath) < strLength) then

        if toPath <> toPathOpen then

            if toPathOpen <> "tmp" then objWrite.Close

            tmpPath = toPath

            if whereTo = "Y" then
                toPath = FSO.GetAbsolutePathName (".") & "\"
            end if

            Set objWrite = FSO.OpenTextFile(toPath & plFileName, ForWriting, True, TristateUseDefault)

            toPath = tmpPath
            tmpPath = ""

        end if

        objWrite.WriteLine strLine

    end if

    toPathOpen = toPath

Loop

objWrite.Close
objStream.Close
MsgBox "Playlists been processed."
WScript.Quit(0)

' script ends ------------------------------------------------------------------------


IIRC, this script and batch worked on W2000/XP but I have not tried it on Vista/W7/W8 systems (maybe some changes needs to be made in VBScript).

Organizing old files
Reply #5
Damn, where do i begin with that one?

  • Juha
  • [*][*][*][*][*]
Organizing old files
Reply #6
Damn, where do i begin with that one?


Hmm... save the 1st listing as m3u.bat and the 2nd listing as MakeM3U.vbs into same folder, which is located above all your music files (if needed, you can change the DIR command to look from other place as it now looks from current folder and its sub folders).

Example:

c:\Temp\

      ....SubPath\

      ....SubPath2\

      ....Music\

      ....Audio\

      ....m3u.bat

      ....makem3u.vbs

(In above case, all folders under C:\Temp are scanned. If yoy want to scan only the Audio\ -folder and its sub folders, change the DIR command to point to the Audio\ -folder or move m3u.bat and makem3u.vbs into Audio\ -folder and run the m3u.bat in there.)

Open the system command prompt, navigate to the folder where m3u.bat/makem3u.vbs are located, execute the m3u.bat, answer "N" when asked for target m3u -file location. That's all.

Ofcourse scripting features needs to be enabled and accessible (admin).
  • Last Edit: 21 February, 2014, 03:44:58 AM by Juha

Organizing old files
Reply #7
Strange, I've just noticed when you change the names with mp3tag it changes the file. I mean the changed file and original file are no longer considered duplicates. Can changing a few letters really affect the checksum of a file?

  • AndyH-ha
  • [*][*][*][*][*]
Organizing old files
Reply #8
Tags are added to the file. That is where they exist. The audio data does not get changed but any tag change makes the file itself different than it was before.

Organizing old files
Reply #9
Oh, okay makes sense. No wonder the program I use to find duplicates could not find the original and the one I changed with mp3tag. The difference is minuscule, but it's there. Btw, I found there is a way to add an m3u playlist with mp3tag, but I'm having problems separating by folder. It adds it to the root folder, but not each individual folder.

  • Juha
  • [*][*][*][*][*]
Organizing old files
Reply #10
...

IIRC, this script and batch worked on W2000/XP but I have not tried it on Vista/W7/W8 systems (maybe some changes needs to be made in VBScript).


Looks like script/batch still works well on 32-bit W7. For my ~1000 album library it took only couple seconds to create/update all m3u files.


Organizing old files
Reply #11
...

IIRC, this script and batch worked on W2000/XP but I have not tried it on Vista/W7/W8 systems (maybe some changes needs to be made in VBScript).


Looks like script/batch still works well on 32-bit W7. For my ~1000 album library it took only couple seconds to create/update all m3u files.

Okay, so how do I get 'Van Halen (1978) - Van Halen' and so on?

  • Juha
  • [*][*][*][*][*]
Organizing old files
Reply #12
...  IIRC, this script and batch worked on W2000/XP but I have not tried it on Vista/W7/W8 systems (maybe some changes needs to be made in VBScript).
    Looks like script/batch still works well on 32-bit W7. For my ~1000 album library it took only couple seconds to create/update all m3u files.
Okay, so how do I get 'Van Halen (1978) - Van Halen' and so on?


Have you tried if Mediamonkey handles everything you're after?


Organizing old files
Reply #13
Okay, I've spent some time with Mediamonkey and decided it wasen't for me sorry. Is there a way to get the 'Van Halen (1978) - Van Halen'.m3u with your code? Thanks.

  • Juha
  • [*][*][*][*][*]
Organizing old files
Reply #14
Okay, I've spent some time with Mediamonkey and decided it wasen't for me sorry. Is there a way to get the 'Van Halen (1978) - Van Halen'.m3u with your code? Thanks.


If you use that type of folder naming showed in your #1 post then no.

If  the name '[1978] Van Halen.m3u' is enough good for you then just edit the code where the final m3u filename is build by removing the artist part:

Replace the line

plFileName = Mid(toPath, posArtist, posAlbum-posArtist-1) & "-" & Mid(toPath, posAlbum, len(toPath) - posAlbum) & ".m3u"

by this code

plFileName = Mid(toPath, posAlbum, len(toPath) - posAlbum) & ".m3u"




If you vant to translate [] to () then you need to add two lines of code:

Replace(plFileName,"[","("))

Replace(plFileName,"]",")"))

right after the line starting as 'plFileName = Mid(toPath, ...'




Note: Just in case you don't want all your m3u files become affected by this changed script then just enable the readonly attribute for those you want to keep untouched.