IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Organizing old files
audioloser
post Feb 20 2014, 02:04
Post #1





Group: Members
Posts: 23
Joined: 20-April 03
Member No.: 6081



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.
Go to the top of the page
+Quote Post
mjb2006
post Feb 20 2014, 02:51
Post #2





Group: Members
Posts: 829
Joined: 12-May 06
From: Colorado, USA
Member No.: 30694



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
'['%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
[%discnumber%-]$ifgreater(%track%,0,$num(%track%,2),%track%)
Go to the top of the page
+Quote Post
audioloser
post Feb 20 2014, 04:45
Post #3





Group: Members
Posts: 23
Joined: 20-April 03
Member No.: 6081



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.
Go to the top of the page
+Quote Post
Mach-X
post Feb 20 2014, 07:04
Post #4





Group: Members
Posts: 275
Joined: 29-July 12
From: Windsor, On, Ca
Member No.: 101859



I think he meant to use mp3tag to sort, and then foobar to generate the m3us.
Go to the top of the page
+Quote Post
Juha
post Feb 20 2014, 11:37
Post #5





Group: Members
Posts: 468
Joined: 14-February 07
From: EU-FIN
Member No.: 40610



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
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
' 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).
Go to the top of the page
+Quote Post
audioloser
post Feb 21 2014, 04:50
Post #6





Group: Members
Posts: 23
Joined: 20-April 03
Member No.: 6081



Damn, where do i begin with that one?
Go to the top of the page
+Quote Post
Juha
post Feb 21 2014, 09:43
Post #7





Group: Members
Posts: 468
Joined: 14-February 07
From: EU-FIN
Member No.: 40610



QUOTE (audioloser @ Feb 21 2014, 07:50) *
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).

This post has been edited by Juha: Feb 21 2014, 09:44
Go to the top of the page
+Quote Post
audioloser
post Feb 24 2014, 03:17
Post #8





Group: Members
Posts: 23
Joined: 20-April 03
Member No.: 6081



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?
Go to the top of the page
+Quote Post
AndyH-ha
post Feb 24 2014, 03:43
Post #9





Group: Members
Posts: 2210
Joined: 31-August 05
Member No.: 24222



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.
Go to the top of the page
+Quote Post
audioloser
post Feb 24 2014, 07:16
Post #10





Group: Members
Posts: 23
Joined: 20-April 03
Member No.: 6081



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.
Go to the top of the page
+Quote Post
Juha
post Feb 24 2014, 10:07
Post #11





Group: Members
Posts: 468
Joined: 14-February 07
From: EU-FIN
Member No.: 40610



QUOTE (Juha @ Feb 20 2014, 14:37) *
...

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.

Go to the top of the page
+Quote Post
audioloser
post Feb 26 2014, 06:09
Post #12





Group: Members
Posts: 23
Joined: 20-April 03
Member No.: 6081



QUOTE (Juha @ Feb 24 2014, 02:07) *
QUOTE (Juha @ Feb 20 2014, 14:37) *
...

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?
Go to the top of the page
+Quote Post
Juha
post Feb 26 2014, 18:37
Post #13





Group: Members
Posts: 468
Joined: 14-February 07
From: EU-FIN
Member No.: 40610



QUOTE (audioloser @ Feb 26 2014, 09:09) *
QUOTE (Juha @ Feb 24 2014, 02:07) *
QUOTE (Juha @ Feb 20 2014, 14:37) *
... 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?

Go to the top of the page
+Quote Post
audioloser
post Mar 4 2014, 04:18
Post #14





Group: Members
Posts: 23
Joined: 20-April 03
Member No.: 6081



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.
Go to the top of the page
+Quote Post
Juha
post Mar 4 2014, 08:59
Post #15





Group: Members
Posts: 468
Joined: 14-February 07
From: EU-FIN
Member No.: 40610



QUOTE (audioloser @ Mar 4 2014, 06:18) *
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.

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th October 2014 - 14:53