Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Masstagger and Renaming (Read 3071 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Masstagger and Renaming

I like to rename my files using this format

artist - album - tracknumber - tracktitle.format

My issue comes with long filenames, I often get errors from long filenames and foobar2000 not being able to rename, I assume, because the filename is too long.

Anyone else run into this and found good solutions? I wouldn't mind truncating say the tracktitle if needed as long as the tag information remaings intact.

Thanks
Scott

Masstagger and Renaming

Reply #1
You could take advantage of directory structure:
artist\album\tracknumber - tracktitle.format

Otherwise I think you'll hit the filename max length for a lot of tracks (for some of mine without even getting as far as the track number).  I want to say the max characters in a WinXP filename is 255, someone correct me if I'm wrong.

Edit: Here's a pseudocode snippit that would do what you want though, some of the syntax might be off but it gives the general idea.

Code: [Select]
$if($len(%artist%)+$len(%album%)+$len(%tracknumber%)+$len(%tracktitle%)+13 > 255,%artist% - %album% - %tracknumber% - $substr(%tracktitle%,1,255-($len(%artist%)+$len(%album%)+$len(%tracknumber%)+13)),%artist% - %album% - %tracknumber% - %tracktitle%)


The 13 in there is the character count for your dashes and .??? extension.

Quote
I like to rename my files using this format

artist - album - tracknumber - tracktitle.format

My issue comes with long filenames, I often get errors from long filenames and foobar2000 not being able to rename, I assume, because the filename is too long.

Anyone else run into this and found good solutions? I wouldn't mind truncating say the tracktitle if needed as long as the tag information remaings intact.

Thanks
Scott
[a href="index.php?act=findpost&pid=346380"][{POST_SNAPBACK}][/a]

Masstagger and Renaming

Reply #2
No need to make it that complicated... the following should already be enough:

Code: [Select]
$replace([%artist%\][%album%\][CD%disc% - ]][%tracknumber% - ]%title%,and,&,And,&)

Whats the replace for? Well, it will convert every "and" to a "&" to squeeze out more space.

If you use fb2k 0.9beta, then adding ALBUM ARTIST support is easy:
Code: [Select]
$replace([%album artist%\][%album%\][CD%disc% - ]][%tracknumber% - ][%track artist% - ]%title%,and,&,And,&)


- Lyx
I am arrogant and I can afford it because I deliver.

Masstagger and Renaming

Reply #3
Hm... I got a similar, yet mut simpler question... How do I tell masstagger to replace all the underlines in the filenames by spaces, when guessing the tags from the filenames?
Where do I put the $replace...-code? Is it 'Format "TITLE" using "$replace..."'? Or "Input Data (One line per track)"!?

Masstagger and Renaming

Reply #4
Just like you first thought  It wouldn't have hurt you had you tried it yourself

Masstagger and Renaming

Reply #5
Quote
Just like you first thought  It wouldn't have hurt you had you tried it yourself
[a href="index.php?act=findpost&pid=351842"][{POST_SNAPBACK}][/a]
You're definitely right, but I didn't deem myself able enough to do it right. I was afraid to mess things up. $replace(%title%,_, ) seems to work. How do I write the syntax if I want to do the replacement for all the tags? "$replace([%title%],[%album%],[%artist%]),_, )"? (Can't try it, no files with underlines left.)
I can't do that, since there's only one "destination field", right?

Can I tell masstagger to guess tags from the folder in which the files are!? Didn't find anything, this would be rad!

 

Masstagger and Renaming

Reply #6
You were right again. You'll just need to do many "format values", one with $replace(%title%,'_',' ') one with $replace(%artist%,'_',' ') etc, each with the correct destination field.
For title formatting strings meant for display, you can have something like $replace(%artist% - %title% - some huge string,a,b) if you want.
Also, if you didn't notice it already, you only need to use one replace function for replacing multiple different characters/strings. $replace(%title%,this,with this,and this,with this,and this,with this).

For the second, I'm not sure as I've never tried it, but you could try to use the "format values from other fields" again, with $directory(%_path%) as a part of the formatting pattern.

And if you're afraid to mess up something, just copy some of your files and test with them (you can even add underlines to their filenames  )