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: Title Fomating - Sort (Read 3404 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Title Fomating - Sort

Is there a way to sort my Album List Panel like this

A+
    Albert, Der
R+
    Rolling Stones, The

W+
    Wrestler, A


I know the $cwb_ltrim funktion, but i find no code to begin with an alphabetic list and only with THE, i have a solution, like this

Code: [Select]
$left($if($strcmp($substr(%artist%,1,4),'The '),$substr(%artist%,5,$len(%<artist>%))', The',%artist%),1)|$if($strcmp($substr(%artist%,1,4),'The '),$substr(%artist%,5,$len(%<artist>%))', The',%artist%)|'['$cut($if2(%year_album%,%date%),4)']' • [%album%]|[[%discnumber%.]%tracknumber%. ][%track artist% - ]%title%


Thank you and sorry for my poor english :-)

Title Fomating - Sort

Reply #1
$left(%artist%,1)'+'|%artist%

that works for using the first letter and organizing like that. you'll need to alter the $left(%artist%,1)'+' with $cwb_Itrim if you want to get rid of "the", but functionally it works.

Title Fomating - Sort

Reply #2
thanks for the answer,

yes, if you see my code before, i used the "$left(%artist%,1)" code, but with "$cwb_Itrim" i didn´t find a working string, shame on me :-) the next problem i fear is to send the "the" or "a" behind the %artist%

greez
mondschein

P.S the "+" was a formating problem here, i want No extra "+"

Title Fomating - Sort

Reply #3
my mistake, I glazed over your code.

So you want to make your album list start with the letter, followed by "artist, the", followed by whatever else? try this:

Code: [Select]
$left($cwb_ltrim(%artist%,The ,A ,Der ),1)|$if($strcmp(%artist%,$cwb_ltrim(%artist%,The ,A ,Der )),%artist%,$cwb_ltrim(%artist%,The ,A ,Der )',' $replace(%artist%,$cwb_ltrim(%artist%,The ,A ,Der ),))


that'll give you this:

A+
Albert, Der
R+
Rolling Stones, The

W+
Wrestler, A

(without the +)

Title Fomating - Sort

Reply #4
Yes, that´s what i want

Code: [Select]
$left($cwb_ltrim(%artist%,The ,A ,Der ),1)|$if($strcmp(%artist%,$cwb_ltrim(%artist%,The ,A ,Der )),%artist%,$cwb_ltrim(%artist%,The ,A ,Der )',' $replace(%artist%,$cwb_ltrim(%artist%,The ,A ,Der ),))


i fear that myself never couldn't find this way, thank you very much for this fine string -

greetings from berlin, germany

Title Fomating - Sort

Reply #5
bitte sehr! Deutschland ist sehr schön  Tschüss!