Author Topic: Library organize pattern not shortening filenames correctly  (Read 1919 times)

ToasterFaerie

  • Newbie
  • *
  • Posts: 13
I need to keep my filename lengths under 143 characters, so I use this pattern to organize my library:
$Left(<Album Artist>,130)\$Left(<Album>,130)\<Disc-Track#> $Left(<Title>,130)

However this is not working in some cases. For example I have this as an album name, and the directory name is not truncated when put in my library:

"リズム怪盗R 皇帝ナポレオンの遺産 オリジナル・サウンドトラック [Rhythm Thief & the Emperor's Treasure: Original Soundtrack]"

It seems to only happen with titles containing non-English characters, but that could be because those titles are just more likely to be so long (I often include the original title and an English translation for easier searching).

I'm using version 3.2.6741 on Windows 10.

Thanks for any help!

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
I find it hard to believe this to be the case and trying now its working fine for me.
I am moving this to the questions section in case anyone is willing to spend time going through it with you.
If it really is a bug then i will look at it further but i dont have much time at the moment

ToasterFaerie

  • Newbie
  • *
  • Posts: 13
I understand if it's not a priority. I'll just find another way to shorten the long filenames. However, you can see here in the organize window the directory name is not recognized as being too long (the full album name is 150 characters). Maybe I am overlooking something, but this has worked for me in the past.


psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Is it the full path that needs to be under 143 characters? In that case, I can see why this isn't working. The 130 applies for each field.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

ToasterFaerie

  • Newbie
  • *
  • Posts: 13
I want the directory name to be short as well. The album title is 150 characters long, even though I've set 130 as the limit.

(The reason for the limit is because I encrypt and backup to the cloud with rclone, and it chokes encrypting directories or files >143 characters.)


phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9304
The maximum allowable is 260 characters, including the path, the filename, and the extension. Your template would allow a maximum of 390 as you have each of the -three- components with a maximum of 130.

The directory name can not be shortened as Windows would not be able to find the directory. I suggest shortening the album title, the album artist, and the track title.

This is what I use to prevent long paths:
$RemoveSortWords($Left(<Album Artist>,50))\$Left(<Album>,50)\<Disc-Track#> - $Left(<Title>,50)
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
I thought longer filenames were okay now in Windows? But if you say 143 is the limit for your software, we can work with that.

Have you tried a different approach like removing either the original name or the English translation from the file path? Just do a split on "[" and choose 1 or 2 depending on which piece you want (plus any other formatting you want).
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9304
I thought longer filenames were okay now in Windows?
Quite possible. I did a quick google search and the first two hits said 260. There was no date on the articles I read. As is often typical of online information.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

ToasterFaerie

  • Newbie
  • *
  • Posts: 13
Have you tried a different approach like removing either the original name or the English translation from the file path? Just do a split on "[" and choose 1 or 2 depending on which piece you want (plus any other formatting you want).

I didn't realize that was a possibility. That's a great idea, so I can still preserve all the information in the album tag. Thanks for the suggestion!

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
I thought longer filenames were okay now in Windows?
Quite possible. I did a quick google search and the first two hits said 260. There was no date on the articles I read. As is often typical of online information.

I guess you have to actually enable it to make that work: https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/

I remember Steven putting in handling for long filenames a while back, that's the only reason I was even aware of it.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Have you tried a different approach like removing either the original name or the English translation from the file path? Just do a split on "[" and choose 1 or 2 depending on which piece you want (plus any other formatting you want).

I didn't realize that was a possibility. That's a great idea, so I can still preserve all the information in the album tag. Thanks for the suggestion!

You're welcome!  If you haven't discovered it yet, you might find this page helpful: https://musicbee.wikia.com/wiki/Functions
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

hiccup

  • Sr. Member
  • ****
  • Posts: 7790
This is what I use to prevent long paths:
$RemoveSortWords($Left(<Album Artist>,50))\$Left(<Album>,50)\<Disc-Track#> - $Left(<Title>,50)

Stumbling upon this thread while checking out 'reorganising' and 'path lenghts':

I believe something like this would work too:
$RemoveSortWords($Left(<Album Artist>\<Album>\<Disc-Track#> - <Title>),150)

Since it's a bit more dynamic, it has the advantage that it will not cut-off longer Titles when Album is short, cut-off longer Album Artists when Titles are short, etc.
And if you know the length of your on backup path, you could probably set the value a bit higher too.