Skip to main content

Topic: Rename mixed FLAC/MP3 files into folders (Read 5456 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Seufari
  • [*]
Rename mixed FLAC/MP3 files into folders
So here is what I am wanting to do... It doesn't seem like much in my eyes, but I cannot seem to find the best way to do it.

I have flac and mp3 files intermingled in a unsorted folder.  I want a program to separate the two into separate directories according to their extension and then by their tag data. 

So here is what it looks like:

Input:
C:\unsorted folder\random subdirectories\mp3 and flac files

Output:
C:\music - mp3\file directories according to tag data\mp3 files
C:\music - flac\file directories according to tag data\flac files


Is there a program that will get this done?
  • Last Edit: 02 December, 2009, 03:23:22 AM by Seufari

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Rename mixed FLAC/MP3 files into folders
Reply #1
foobar could do this for you, or (I expect) MP3Tag.

I'll deal with foobar as I don't know MP3Tag (although I think the syntax is the same/similar).

You would throw all files into a playlist, and then choose to move or copy them using a file name pattern like:

Music - %codec%\[%album artist%\][%album%\][Disc %discnumber%\][%tracknumber% - ]%title%$if($meta(album artist),' ('$meta(artist)')',)

... choosing a destination folder of C:\.

You will find the file operations in the context menu of the playlist (select all files, right click, and choose "File Operations" > "Move To".

There is probably a guide here that explains the process in depth further.

Use the preview in the dialogue to ensure that the files will be renamed as you hope.

Edit: The files will be named according to their tags.  You must ensure that your tags are accurate before you perform the operation.  It's always useful to have accurate tags in any case.  "Various Artists" albums should have the ALBUM ARTIST "Various Artists".  Albums with only one artist should not use ALBUM ARTIST, only ARTIST.

The file name pattern above is (apart from the initial folder) the string that I use, and will result in file paths like so:

Music - MP3\Pixies\Doolittle\01 - Debaser.mp3
Music - FLAC\Eels\Blink Lights And Other Revelations\Disc 1\01 -  Theme From Blinking Lights.flac
Music - FLAC\Various Artists\8 Mile Soundtrack\01 - Lose Yourself (Eminem).flac
Music - MP3\Various Artists\CBeebies - The Official Album\Disc 2\01 - Mambo No 5 (Bob The Builder).mp3
  • Last Edit: 02 December, 2009, 04:44:15 AM by Synthetic Soul
I'm on a horse.

  • probedb
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #2
Pretty sure mp3tag can do a similar thing.

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Rename mixed FLAC/MP3 files into folders
Reply #3
Yes, I very much expect it will, and the OP may be happier to use it if he is happy with his player already.

Personally, I use foobar for playing, tagging, renaming, the lot.
I'm on a horse.

  • DragonQ
  • [*]
Rename mixed FLAC/MP3 files into folders
Reply #4
I actually wrote a program in VB.NET to do this for me based on tags after I recovered a load of WMA Lossless files from a dead HDD (the recovery software obviously couldn't find the folder or file names because the MFT was corrupt so they were named "Windows Media Audio (xxxx).wma" where xxxx was a random number). Probably wouldn't be useful for you though.
  • Last Edit: 02 December, 2009, 05:24:49 AM by DragonQ

  • odyssey
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #5
You can always use %filename% in correlation with Synthetic Soul's example in foobar2000 if you are unsure if your tags are correct.
Can't wait for a HD-AAC encoder :P

  • Zarggg
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #6
IIRC, doesn't %album artist% defer to %artist% if no Album Artist tag exists?

  • Seufari
  • [*]
Rename mixed FLAC/MP3 files into folders
Reply #7
Thanks for the quick replys...

Quote
You will find the file operations in the context menu of the playlist (select all files, right click, and choose "File Operations" > "Move To".


Unfortunately my foobar does not have this context menu... When I right click, I get:

Remove
Crop
Sort
Cut
Copy
Utils
Add to Playback Queue
Open Containing Folder
ReplayGain
Properties
Convert

Why is mine different?


  • dios-mt
  • [*]
Rename mixed FLAC/MP3 files into folders
Reply #8
Unfortunately my foobar does not have this context menu...


Which version you have installed?
File operations came with Version 0.9.5.
Latest Version is 0.9.6.9 or 1.0 beta 2a.

  • Seufari
  • [*]
Rename mixed FLAC/MP3 files into folders
Reply #9
Unfortunately my foobar does not have this context menu...


Which version you have installed?
File operations came with Version 0.9.5.
Latest Version is 0.9.6.9 or 1.0 beta 2a.


I have the latest non-beta version...

Re-installing... Seems File Operations is not installed by default...
  • Last Edit: 02 December, 2009, 11:38:50 AM by Seufari

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Rename mixed FLAC/MP3 files into folders
Reply #10
IIRC, doesn't %album artist% defer to %artist% if no Album Artist tag exists?
Yes, it does.

I use the system - and I believe it is reasonably popular - that relies on ALBUM ARTIST only being there if it is required.  Therefore on "normal" albums I set ARTIST only, and on VA albums I set ALBUM ARTIST to "Various Artists" and ARTIST to the track artist.  This means that %album artist% will always provide the album artist, but $if($meta(album artist),' ('$meta(artist)')',) will only append the artist name to the track title if ALBUM ARTIST is set.

Edit: Perhaps a more robust script may only append the artist if ALBUM ARTIST is present and is different to ARTIST, but I personally don't need to complicate my script further.
  • Last Edit: 02 December, 2009, 12:23:43 PM by Synthetic Soul
I'm on a horse.

  • tpijag
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #11
I use pretty much the same system.

I believe you can simplify above.

Would adding [%track artist%] to track title column formatting accomplish the same as the if statement?

Just FYI

terry
  • Last Edit: 02 December, 2009, 12:30:03 PM by tpijag

  • Zarggg
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #12
Yes, that's essentially my line of thought, tpijag. I was hoping Synthetic Soul could confirm or deny that.

I actually use the same tagging system (Album Artist iff Artist is not common for all tracks, or release entity -- in the case of Japanese doujin circle releases -- is not the same as the actual artist). However, in my tagging scripts I use something similar to "%album artist% ... [%artist%] ... "
  • Last Edit: 03 December, 2009, 10:28:11 AM by Zarggg

  • odyssey
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #13
%album artist% will return the ALBUMARTIST field if it's defined! If it's not set, it will rely on the %artist% field.

Adding brackets [ ] around a tag makes it only appear if the tag is set. If a tag is not set, it will return a questionmark "?" instead.

There's no such thing as %track artist% - You have %artist%, and this will always return the ARTIST field - Not ALBUMARTIST even if it's set or not.

Visiting the foobar2000 forum regarding foobar2000 questions might yield better results - We are a few more than just Synthetic Soul that uses foobar2000  Note there's also an IRC channel for quick/small questions, #foobar2000 @freenode
Can't wait for a HD-AAC encoder :P

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Rename mixed FLAC/MP3 files into folders
Reply #14
Would adding [%track artist%] to track title column formatting accomplish the same as the if statement?
Yes, that's essentially my line of thought, tpijag. I was hoping Synthetic Soul could confirm or deny that.
Well, I have no idea how long %track artist% has been available, but I must admit I had no knowledge of it, and you are correct: it could simplify my string.  I've been using the above string for a while, and I just haven't bothered trying to improve it.

It seems that I could change:

Code: [Select]
%title%$if($meta(album artist),' ('$meta(artist)')',)

... to:

Code: [Select]
%title%[' ('%track artist%')']

Thanks for the info.
I'm on a horse.

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Rename mixed FLAC/MP3 files into folders
Reply #15
Edit: Simplify and improve: as it will deal with tracks with ARTIST and ALBUM ARTIST being the same.

Bah!  What happened to quick posts being joined!
  • Last Edit: 03 December, 2009, 11:15:13 AM by Synthetic Soul
I'm on a horse.

  • Teknojnky
  • [*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #16
Mediamonkey also does this (auto-organize) and has some conditional branching you can use to customize the paths/naming for particular tags (or absence of tag).

For example, my rather complex and long 'final resting place' mask:

Code: [Select]
$left(\Media\$upper(<Type>)\$if(<Album Artist>,$if(<Album Artist>=various,_<Album Artist>,$if(<Album Artist>=techno,_<Album Artist>,$if(<Album Artist>=soundtrack,_<Album Artist>,<Album Artist@1>\<Album Artist>))),<Artist@1>\<Artist>)\$if(<Album>,$if(<Year>,<Year> - )<Album> [$upper(<Type>)])\$if(<Track#>,<Track#:2> - )<Artist> - <Title>,230)


results in a path like

J:\Media\FLAC\A\A Silver Mt. Zion\2000 - He Has Left Us Alone, but Shafts of Light Sometimes Grace the Corner of Our Rooms... [FLAC]\01 - A Silver Mt. Zion - Broken Chords Can Sing a Little.flac
Last.FM Nodes for your library @ http://build.last.fm/item/356

  • odyssey
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #17
So, my sig finally made a point...

%track artist% only returns ARTIST field if it's different from ALBUMARTIST it seems? Well guess that could turn out to be useful some day, but currently... not for me.
Can't wait for a HD-AAC encoder :P

  • odyssey
  • [*][*][*][*][*]
Rename mixed FLAC/MP3 files into folders
Reply #18
It seems that I could change:

Code: [Select]
%title%$if($meta(album artist),' ('$meta(artist)')',)

... to:

Code: [Select]
%title%[' ('%track artist%')']

Just to make it clear, those two formattings are NOT the same!
  • Last Edit: 03 December, 2009, 12:41:09 PM by odyssey
Can't wait for a HD-AAC encoder :P

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Rename mixed FLAC/MP3 files into folders
Reply #19
No.  I assume you are referring to the point I made in post #16?

The first will append " (<artist>)" if ALBUM ARTIST has been set to any value.  If ARTIST is not set you will get " ()".

The second will append " (<artist>)" if ALBUM ARTIST has been set to a value that is different to ARTIST.  If ARTIST is not set you will get "" (nothing).

It works for my current system, and will cope better with tracks that have both set the same (and even tracks that have no ARTIST tag set, of which I have none).  This has also spurred me to make another amendement to cope similarly with a TOTALDISCS value of "1" (I don't want a "Disc N" subfolder if there is only one disc), making my new string:

Code: [Select]
[%album artist%\][%album%\]$ifgreater(%totaldiscs%,1,Disc %discnumber%\,)[%tracknumber% - ]%title%[' ('%track artist%')']

Thanks again to tpijag for the suggestion.

I'm on a horse.