Skip to main content
Topic: Short albums names in list without "..." at the end "$cut(%album%,50)..." (Read 388 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Short albums names in list without "..." at the end "$cut(%album%,50)..."

I don't know if I'm doing this right or if this is the intended way it works but I'm trying to use "$cut(%tag%,X)..." in Album List and it always ends with "..." even if it is short enough to not have to be cut.

For example with "$cut(%album%,50)..." Number Ones becomes Number Ones... even when it's shorter than 50 chars so it doesn't need "..." at the end.

I've been using https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Titleformat_Examples to try and figure it out but I'm stuck.

Any help would be appreciated, I'd like to only have "..." at the end of an album if it has to be cut to fit.

Re: Short albums names in list without "..." at the end "$cut(%album%,50)..."

Reply #1
The result you're getting is correct. The $cut function merely cuts after X characters, you append ... outside of the function so it gets appended on any text even those that aren't cut.
Perhaps you could try something like this.
Code: [Select]
$ifgreater($len(%tag%,50),$cut(%tag%,50)...,%tag%)

Re: Short albums names in list without "..." at the end "$cut(%album%,50)..."

Reply #2
The result you're getting is correct. The $cut function merely cuts after X characters, you append ... outside of the function so it gets appended on any text even those that aren't cut.
Perhaps you could try something like this.
Code: [Select]
$ifgreater($len(%tag%,50),$cut(%tag%,50)...,%tag%)
Hmm, don't know how to get that one to work, I tried the one you linked and I get invalid syntax.

Re: Short albums names in list without "..." at the end "$cut(%album%,50)..."

Reply #3
Yeah, apologies it wasn't correct, should've tested it first, this one is:

Code: [Select]
$ifgreater($len(%tag%),50,$cut(%tag%,50)...,%tag%)

Re: Short albums names in list without "..." at the end "$cut(%album%,50)..."

Reply #4
Yeah, apologies it wasn't correct, should've tested it first, this one is:

Code: [Select]
$ifgreater($len(%tag%),50,$cut(%tag%,50)...,%tag%)
Seems to work like I wanted, thanks a lot!

Re: Short albums names in list without "..." at the end "$cut(%album%,50)..."

Reply #5
Here's a variation. This cuts at 50 characters but the shortened version won't be any longer than 50 characters.

With a space before "..."
$iflonger(%tag%,50,$replace($cut(%tag%,46) ...,  ..., ....),%tag%)

Without a space
$iflonger(%tag%,50,$replace($cut(%tag%,47)..., ...,....),%tag%)


 
SimplePortal 1.0.0 RC1 © 2008-2020