IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
Ignore leading "the" when sorting and removing splitter (0.9, Split from "foobar2000 0.9.5 beta 2"
TheSaneLunatic
post Oct 22 2007, 01:40
Post #1





Group: Members
Posts: 29
Joined: 16-August 07
Member No.: 46237



I have a quick question... how does one sort artists in order to bypass "the" in the beginning? I know where to place it, just not the code. Thanks in advance!!!
Go to the top of the page
+Quote Post
TheSaneLunatic
post Nov 2 2007, 08:31
Post #2





Group: Members
Posts: 29
Joined: 16-August 07
Member No.: 46237



After reading the feature request topic and all 10 pages of this topic, and I apologize if this feature has been discussed and/or denied before in another topic, but personally this is an annoying pet peeve of mine. Whether I make a splitter for my configuration, and I decide I do not want the splitter after all, I cannot just remove it at all. In fact, one must literally start from scratch just to remove said splitter. This also effects Scratchbox as well. I would really love to have an option while editing the layout to remove a splitter... that would be lovely!!!


Also, I mentioned this quite a while ago, and although I've read a response to my following question somewhere by picmixer, foosion, or Frank that this would make things more complex for the novice user...,
QUOTE (TheSaneLunatic @ Oct 21 2007, 17:40) *
I have a quick question... how does one sort artists in order to bypass "the" in the beginning? I know where to place it, just not the code. Thanks in advance!!!
Go to the top of the page
+Quote Post
Frank Bicking
post Nov 2 2007, 10:26
Post #3





Group: Super Moderator
Posts: 1832
Joined: 24-July 02
From: Berlin, Germany
Member No.: 2776



QUOTE
I would really love to have an option while editing the layout to remove a splitter...

Please read this post.
Go to the top of the page
+Quote Post
fbuser
post Nov 2 2007, 10:52
Post #4





Group: Developer
Posts: 682
Joined: 26-September 07
Member No.: 47369



QUOTE (TheSaneLunatic @ Nov 2 2007, 08:31) *
Also, I mentioned this quite a while ago, and although I've read a response to my following question somewhere by picmixer, foosion, or Frank that this would make things more complex for the novice user...,
QUOTE (TheSaneLunatic @ Oct 21 2007, 17:40) *

I have a quick question... how does one sort artists in order to bypass "the" in the beginning? I know where to place it, just not the code. Thanks in advance!!!



The best solution for album list (and facets, too) would be, if there was a separation between display and sorting. I use for sorting an extra field %artist sort%. So there is no need for complicated title formatting and I can sort all artists the way I want. For example: I want to sort "Ludwig van Beethoven" under the letter B, but display it as I wrote before. I use "BEETHOVEN LUDWIG" as sortstring and get the desired result. It's a little bit more work while tagging, but it's worth it.
Go to the top of the page
+Quote Post
Frank Bicking
post Nov 2 2007, 14:31
Post #5





Group: Super Moderator
Posts: 1832
Joined: 24-July 02
From: Berlin, Germany
Member No.: 2776



QUOTE (fbuser @ Nov 2 2007, 10:52) *
The best solution for album list (and facets, too) would be, if there was a separation between display and sorting. I use for sorting an extra field %artist sort%. So there is no need for complicated title formatting and I can sort all artists the way I want. For example: I want to sort "Ludwig van Beethoven" under the letter B, but display it as I wrote before. I use "BEETHOVEN LUDWIG" as sortstring and get the desired result. It's a little bit more work while tagging, but it's worth it.

While it's not a bad idea per se, making it fully configureable doesn't make much sense.

It allows too many nonsensical combinations. How would you sort %artist% by %tracknumber%, for example?

In Facets, you can already add both Artist and Artist Sort columns, sort by the Artist Sort column, and finally hide the column by resizing it to a width of 0px.
Go to the top of the page
+Quote Post
unkwn
post Nov 2 2007, 17:37
Post #6





Group: Members
Posts: 68
Joined: 28-June 06
From: Sweden
Member No.: 32321



QUOTE (TheSaneLunatic @ Oct 21 2007, 17:40) *
I have a quick question... how does one sort artists in order to bypass "the" in the beginning? I know where to place it, just not the code. Thanks in advance!!!

CODE
$replace(%artist%,'The ',)


--------------------
Ignorance is bliss.
Go to the top of the page
+Quote Post
TheSaneLunatic
post Nov 2 2007, 23:30
Post #7





Group: Members
Posts: 29
Joined: 16-August 07
Member No.: 46237



QUOTE (Frank Bicking @ Nov 2 2007, 02:26) *
QUOTE
I would really love to have an option while editing the layout to remove a splitter...

Please read this post.


Oh, believe me, I did read that very post... I just hoped that it'll be a simpler method than the one proposed. However, doing that does eliminate the splitter altogether, and I am happy with that. Thanks for showing that post though!


QUOTE (unkwn @ Nov 2 2007, 09:37) *
I have a quick question... how does one sort artists in order to bypass "the" in the beginning? I know where to place it, just not the code. Thanks in advance!!!
CODE
$replace(%artist%,'The ',)


YEAH! That worked perfectly... no more having the multitude of "The" artists cluttering anymore. Thanks unkwn!

This post has been edited by TheSaneLunatic: Nov 2 2007, 23:32
Go to the top of the page
+Quote Post
Jose Hidalgo
post Nov 22 2007, 03:51
Post #8





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



May I ask where exactly this code must be placed in order to ignore the leading "The" in Playlist View ? Is it in Prefs > Default UI > Playlist View > Custom Grouping Schemes, or is it somewhere else ?

BTW, it would be even better if the leading "The" wasn't ignored but placed at the end of the string. e.g. "The Alan Parsons Project" becomes "Alan Parsons Project (The)". Can somebody help me with this one ?

Thanks.
Go to the top of the page
+Quote Post
unkwn
post Nov 22 2007, 05:15
Post #9





Group: Members
Posts: 68
Joined: 28-June 06
From: Sweden
Member No.: 32321



you would replace it anywhere you use %artist% either in your grouping scheme or columns.

to make The Artist becoem Artist, The use this code instead

CODE
$if($strcmp($left(%artist%,4),The ),$right(%artist%,$sub($len(%artist%),4))', 'The,%artist%)


--------------------
Ignorance is bliss.
Go to the top of the page
+Quote Post
Paws
post Nov 22 2007, 05:28
Post #10





Group: Members
Posts: 195
Joined: 3-September 06
Member No.: 34773



Sorry to but in, unkwn thanks for the code works like a charm.
Go to the top of the page
+Quote Post
unkwn
post Nov 22 2007, 06:08
Post #11





Group: Members
Posts: 68
Joined: 28-June 06
From: Sweden
Member No.: 32321



QUOTE (Paws @ Nov 21 2007, 23:28) *
Sorry to but in, unkwn thanks for the code works like a charm.

it's just copied from the wiki tongue.gif


--------------------
Ignorance is bliss.
Go to the top of the page
+Quote Post
Jose Hidalgo
post Nov 22 2007, 06:14
Post #12





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



Thanks unkwn ! biggrin.gif

One question : wouldn't it be more appropriate to have this code ?

CODE
$if($strcmp($left(%album artist%,4),The ),$right(%album artist%,$sub($len(%album artist%),4))', 'The,%album artist%)

EDIT 1 : yes, I have tested and I can confirm : this code seems more appropriate for displaying "VA" albums correctly. It should work even better than the previous code. smile.gif

EDIT 2 : unkwn, your code doesn't seem to work in the Custom Grouping Schemes. What have I done wrong ?

EDIT 3 : fixed (syntax error), but I have another problem : "The Artists" shows well as "Artist, The" in the Playlist View, but it's still sorted alphabetically as "T", not as "A" ! It looks like Facets is doing the sorting well ("The Artist" is sorted as "A"), but not the Playlist View... any ideas ? huh.gif

EDIT 4 : I found it ! You have to enter the code at Preferences > General > "Sort incoming files by" ! laugh.gif This handles the sorting itself, while the Custom Grouping Schemes handle the apparence. Silly me ! tongue.gif

This post has been edited by Jose Hidalgo: Nov 22 2007, 06:38
Go to the top of the page
+Quote Post
unkwn
post Nov 22 2007, 06:38
Post #13





Group: Members
Posts: 68
Joined: 28-June 06
From: Sweden
Member No.: 32321



QUOTE (Jose Hidalgo @ Nov 22 2007, 00:14) *
EDIT 1 : yes, I have tested and I can confirm : this code seems more appropriate for displaying "VA" albums correctly. It should work even better than the previous code. smile.gif

I don't have any VA albums so it's never been an issue for me tongue.gif
QUOTE (Jose Hidalgo @ Nov 22 2007, 00:14) *
EDIT 3 : fixed (syntax error), but I have another problem : "The Artists" shows well as "Artist, The" in the Playlist View, but it's still sorted alphabetically as "T", not as "A" ! It looks like Facets is doing the sorting well ("The Artist" is sorted as "A"), but not the Playlist View... any ideas ? huh.gif

you need to put the code in your sort string

This post has been edited by unkwn: Nov 22 2007, 06:39


--------------------
Ignorance is bliss.
Go to the top of the page
+Quote Post
Jose Hidalgo
post Nov 22 2007, 06:39
Post #14





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



Yes, I've just found it (I've just edited my previous post). Thanks !
Go to the top of the page
+Quote Post
Jose Hidalgo
post Nov 22 2007, 18:57
Post #15





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



Me again. biggrin.gif Just to improve it a bit more :

CODE
[$if($strcmp($left(%album artist%,4),The ),$right(%album artist%,$sub($len(%album artist%),4))' ('The')',%album artist%)]

What if I wanted to take into account several articles ? "The ", "Los " and "Les " for instance. I guess I could just write this :

CODE
[$if($strcmp($left(%album artist%,4),The ),$right(%album artist%,$sub($len(%album artist%),4))' ('The')',%album artist%)][$if($strcmp($left(%album artist%,4),Los ),$right(%album artist%,$sub($len(%album artist%),4))' ('Los')',%album artist%)][$if($strcmp($left(%album artist%,4),Les ),$right(%album artist%,$sub($len(%album artist%),4))' ('Les')',%album artist%)]

But something tells me that there's got to be a simpler way to script this... can someone help ? wink.gif
Go to the top of the page
+Quote Post
pozp
post Nov 23 2007, 09:15
Post #16





Group: Members
Posts: 15
Joined: 21-August 07
Member No.: 46388



Try this (though maybe not a simpler way).

CODE
$put(b,$replace($put(a,$cut(%album artist%,4)),The ,,Los ,,Les ,)$substr(%album artist%,5,999))
$iflonger(%album artist%,$len($get(b)),' ('$trim($get(a))')',)

(1st line: remove "The ", "Los " and "Les ". 2nd line: append these)

If you want to remove leading {A,B,C,D,E} from %field% and append {", A",", B",", C",", D",", E"}, use this.

CODE
$put(c,$replace($put(b,$cut(%field%,$put(a,$strchr(%field%, )))),A ,,B ,,C ,,D ,,E ,)$substr(%field%,$add($get(a),1),999))$iflonger(%field%,$len($get(c)),', '$trim($get(b)),)


Edit: removed useless strings and added generic approach

This post has been edited by pozp: Nov 24 2007, 21:52
Go to the top of the page
+Quote Post
Jose Hidalgo
post Nov 26 2007, 05:52
Post #17





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



Hi pozp, thank you very much. biggrin.gif

I've tried it... but it doesn't seem to work. What have I done wrong ?

Prefs > General > Sort incoming files by :

CODE
$put(c,$replace($put(b,$cut(%album artist%,$put(a,$strchr(%album artist%, )))),The ,,Le ,,Les ,,La ,,Las ,,Los  ,)$substr(%album artist%,$add($get(a),1),999))$iflonger(%album artist%,$len($get(c)),' ('$trim($get(b))')',) $num($sub(3000,%date%),4) [%album%] [%disc%.] [$num(%tracknumber%,2).] $if2(%title%,%_filename_ext%)
Go to the top of the page
+Quote Post
pozp
post Nov 26 2007, 09:18
Post #18





Group: Members
Posts: 15
Joined: 21-August 07
Member No.: 46388



Perhaps removing unnecessary space in "Los " would help.
Go to the top of the page
+Quote Post
Jose Hidalgo
post Nov 26 2007, 15:30
Post #19





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



I got it pozp ! biggrin.gif

I had simply forgotten to do the same thing with the Custom grouping schemes. So now I have the following TWO codes :

Prefs > General :

CODE
$put(c,$replace($put(b,$cut(%album artist%,$put(a,$strchr(%album artist%, )))),The ,,Le ,,Les ,,La ,,Las ,,Los ,)$substr(%album artist%,$add($get(a),1),999))$iflonger(%album artist%,$len($get(c)),' ('$trim($get(b))')',) $num($sub(3000,%date%),4) [%album%] [%disc%.] [$num(%tracknumber%,2).] $if2(%title%,%filename_ext%)


Prefs > Display > Default UI > Playlist view > Custom grouping schemes :

CODE
$put(c,$replace($put(b,$cut(%album artist%,$put(a,$strchr(%album artist%, )))),The ,,Le ,,Les ,,La ,,Las ,,Los ,)$substr(%album artist%,$add($get(a),1),999))$iflonger(%album artist%,$len($get(c)),' ('$trim($get(b))')',) - '['%date%']' %album%[' ('CD %discnumber%')']


The first code is slightly different because it sorts albums by date in inverse chronological order (I like that, shows latest albums first). The second code only handles the way albums are presented in the Playlist view.

What do you think ? Is it perfect or can it be improved ? wink.gif

Thanks again !

Jose

This post has been edited by Jose Hidalgo: Dec 3 2007, 03:07
Go to the top of the page
+Quote Post
Jose Hidalgo
post Dec 2 2007, 17:41
Post #20





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



I think I've managed to improve it a bit :

CODE
$put(c,$replace($put(b,$cut(%album artist%,$put(a,$strchr(%album artist%, )))),The ,,Le ,,Les ,,La ,,Las ,,Los ,)$substr(%album artist%,$add($get(a),1),999))$iflonger(%album artist%,$len($get(c)),' ('$trim($get(b))')',) $num($sub(3000,%date%),4) [%album%] [%disc%] [$num($left(%tracknumber%,2),2)$num($right(%tracknumber%,$sub($len(%tracknumber%),3)),2)] $if2(%title%,%filename_ext%)

The leading "The " part is unchanged, but now the code is also able to handle unusual track numbers that are more than 2 digits long (e.g. for some audiobooks, track numbers such as "14.14"), so that the sorting can be made accordingly. Now the code should be able to handle 2-digit (03), 3-digit (03.2), 4-digit (03.25, 11.42) track numbers, and even more. smile.gif

Question : are both $num functions mandatory, or can they removed in order to simplify the code ? (it's getting a bit long now, I'd like to keep it as short as possible).

This post has been edited by Jose Hidalgo: Dec 3 2007, 03:07
Go to the top of the page
+Quote Post
Jose Hidalgo
post Dec 4 2007, 03:17
Post #21





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



Another small improvement :

CODE
$put(c,$replace($put(b,$cut(%album artist%,$put(a,$strchr(%album artist%, )))),The ,,Le ,,Les  ,,La ,,Las ,,Los ,)$substr(%album artist%,$add($get(a),1),999))$iflonger(%album  artist%,$len($get(c)),' ('$trim($get(b))')',) $num($sub(3000,%date%),4) [%album%] [%discnumber%]  [$num($left(%tracknumber%,3),2)$num($right(%tracknumber%,$sub($len(%tracknumber%),$strchr(%tracknumber%,.))),2)]  $if2(%title%,%filename_ext%)

Now it should work for all %tracknumber% formats, may them be #, ##, #.##, ##.# or ##.##.
Go to the top of the page
+Quote Post
jmlane
post Dec 14 2007, 21:20
Post #22





Group: Members
Posts: 5
Joined: 28-October 07
From: Ch'town, PE
Member No.: 48264



QUOTE (Jose Hidalgo @ Nov 26 2007, 09:30) *
I got it pozp ! biggrin.gif

I had simply forgotten to do the same thing with the Custom grouping schemes. So now I have the following TWO codes :

Prefs > General :

CODE
$put(c,$replace($put(b,$cut(%album artist%,$put(a,$strchr(%album artist%, )))),The ,,Le ,,Les ,,La ,,Las ,,Los ,)$substr(%album artist%,$add($get(a),1),999))$iflonger(%album artist%,$len($get(c)),' ('$trim($get(b))')',) $num($sub(3000,%date%),4) [%album%] [%disc%.] [$num(%tracknumber%,2).] $if2(%title%,%filename_ext%)


Prefs > Display > Default UI > Playlist view > Custom grouping schemes :
CODE
$put(c,$replace($put(b,$cut(%album artist%,$put(a,$strchr(%album artist%, )))),The ,,Le ,,Les ,,La ,,Las ,,Los ,)$substr(%album artist%,$add($get(a),1),999))$iflonger(%album artist%,$len($get(c)),' ('$trim($get(b))')',) - '['%date%']' %album%[' ('CD %discnumber%')']
I don't seem to have the same list structure as this. I am using v0.9.4.5, and I have Preferences > Display > Title Formatting > Playlist.

Is this the same thing, or am I missing a component for foobar?

Thanks for the script!


--------------------
jmlane
Go to the top of the page
+Quote Post
Jose Hidalgo
post Dec 14 2007, 23:47
Post #23





Group: Banned
Posts: 385
Joined: 22-June 06
Member No.: 32111



Why don't you just upgrade to 0.9.5 ?
Go to the top of the page
+Quote Post
sidewalking
post Aug 31 2008, 05:29
Post #24





Group: Members
Posts: 105
Joined: 16-September 03
Member No.: 8871



Sorry to resurrect, but I didn't see anything else in my searches...

The examples here show a display/sort of 'Artist, The' or 'Artist (The)', but is there a way to change only the sorting, and not the display? For example, the artist value of The Jesus and Mary Chain will show 'The Jesus and Mary Chain', but would sort on 'Jesus and Mary Chain'?
Go to the top of the page
+Quote Post
Soviet Commissar
post Nov 13 2009, 22:30
Post #25





Group: Members
Posts: 43
Joined: 8-October 08
From: Virginia, USA
Member No.: 59765



QUOTE (sidewalking @ Aug 30 2008, 23:29) *
Sorry to resurrect, but I didn't see anything else in my searches...

The examples here show a display/sort of 'Artist, The' or 'Artist (The)', but is there a way to change only the sorting, and not the display? For example, the artist value of The Jesus and Mary Chain will show 'The Jesus and Mary Chain', but would sort on 'Jesus and Mary Chain'?

Same as sidewalking, I hate to resurrect as well, but it would be good to know if this can be done (especially if it's just in a script that could be used in Columns UI's filters).
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th September 2014 - 13:44