IPB

Welcome Guest ( Log In | Register )

> foobar2000 Tech Support Forum Rules

Please read foobar2000 Tech Support Forum Rules before posting and comply with all the points.
Failure to provide all the information pointed out in the above document in your post is considered wasting other people's time and in extreme cases will lead to your topic getting locked without a reply.


See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
stripprefix / swapprefix on mutli-value fields does not work
SpaceAgeHero
post Feb 29 2012, 18:13
Post #1





Group: Members
Posts: 115
Joined: 23-August 08
From: Berlin
Member No.: 57417



Hey guys,
could it be that stripprefix / swapprefix does not work with multi-value fields?
Am I doing something wrong?

Go to the top of the page
+Quote Post
q-stankovic
post Mar 1 2012, 20:12
Post #2





Group: Members
Posts: 1685
Joined: 28-May 06
From: Düsseldorf
Member No.: 31251



http://www.hydrogenaudio.org/forums/index....showtopic=38866


--------------------
german support forum: www.foobar-users.de / user: qwert73
Go to the top of the page
+Quote Post
defamp
post Aug 25 2012, 12:02
Post #3





Group: Members
Posts: 5
Joined: 11-February 11
Member No.: 88090



Sorry to bump an old thread, but I am having this same problem as OP, and can't quite work out the implications of the thread linked above...

As in SpaceAgeHero's pic above, "The Chemical Brothers" normally becomes "Chemical Brothers, The" in my album list.
But if the files have multiple values in the "artist" or "album artist" field, the prefix remains, and "The Chemical Brothers" appears in my album list.

Is this a known limitation, or is there some way to resolve this?

I'm using foobar v1.1.7, with the default UI and "album_list" component.

My sorting string looks like this:
CODE
$swapprefix(%<album artist>%)|%date% - %album%|[[%discnumber%.]%tracknumber%. ][%track artist% - ]%title%
Go to the top of the page
+Quote Post
BenB
post Aug 25 2012, 16:31
Post #4





Group: Members
Posts: 328
Joined: 17-April 12
Member No.: 98921



Yes, you've ran into a limitation of Album list in the Default UI. There are workarounds but they require additional components. You can use Facets with the DUI, or you can use Album list panel with Columns UI. Both allow you to use the following:

$meta_branch_stripprefix(tag)
$meta_branch_swapprefix(tag)

The next two take foobar's remapping into account:

$meta_branch_remap_stripprefix(tag)
$meta_branch_remap_swapprefix(tag)


Replace tag with the tag's name only (no %, < or >) such as artist, genre and so on.

EDIT:

Forgot to say that they work just as $stripprefix() and #swapprefix() do. You can specify the prefixes after tag if you wish; otherwise, only "A" and "The" will be moved/removed.

This post has been edited by BenB: Aug 25 2012, 16:40


--------------------
This signature apparently isn't too long.
Go to the top of the page
+Quote Post
defamp
post Aug 25 2012, 18:35
Post #5





Group: Members
Posts: 5
Joined: 11-February 11
Member No.: 88090



Thanks for this swift and concise response, BenB.
I have used both Facets and the Columns UI/Album List set-up in the past, so might give either one another try.

Just to clarify what you mean by 'taking foobar's remapping into account': does this mean that $meta_branch_remap_swapprefix(artist) would involve the possibilities of 'artist', 'composer', 'performer', etc... whereas $meta_branch_swapprefix(artist) wouldn't allow this flexibility? Or am I totally misunderstanding you?

Thanks again.
Go to the top of the page
+Quote Post
trout
post Aug 25 2012, 19:52
Post #6





Group: Members
Posts: 407
Joined: 26-March 09
Member No.: 68400



This is one of the issues that could be avoided by using a custom sort order tag. Instead of always relying on $swapprefix() or $stripprefix(), you can use something like %artist sort% to store an alternate name format. (it can also be used for other preferences such as "Last Name, First Name", or abbreviations, etc.)

So then in Album List you can use something like:
$if2(%<artist sort>%,%<album artist>%)|...


Using this formatting, for example the album "Live At The Greek" with multiple artists "Jimmy Page; The Black Crowes" can be listed for both artists by the %artist sort% tag "Page, Jimmy; Black Crowes, The".

If you use such a custom tag, remember to add it to: Prefs > Advanced > Display > Properties Dialog > Multivalue fields
Go to the top of the page
+Quote Post
mjm716
post Nov 21 2012, 17:14
Post #7





Group: Members
Posts: 82
Joined: 27-May 10
Member No.: 80935



QUOTE (BenB @ Aug 25 2012, 17:31) *
1. Forgot to say that they work just as $stripprefix() and #swapprefix() do. You can specify the prefixes after tag if you wish; otherwise, only "A" and "The" will be moved/removed.

AND

2. Facets also has an option to ignore a leading "The" which means you can use %<insert_tag_name_here>% instead of the title formatting above. This option keeps the "The" at the beginning of the value but sorts the value as if it had been swapped/stripped.


I'm a bit confused about how to use other prefixes with this tip (in Facets)

I've tried : $meta_branch_swapprefix(album artist,a,dj,la,le,les,the,die) with no results.

Can someone help with the correct formatting?

Also to BenB's 2nd point - is there a way to add other prefixes to Facets filtering (e.g. a,dj,la,le,les,die)

thanks!
Go to the top of the page
+Quote Post
BenB
post Nov 21 2012, 19:25
Post #8





Group: Members
Posts: 328
Joined: 17-April 12
Member No.: 98921



QUOTE (mjm716 @ Nov 21 2012, 11:14) *
QUOTE (BenB @ Aug 25 2012, 17:31) *
1. Forgot to say that they work just as $stripprefix() and $swapprefix() do. You can specify the prefixes after tag if you wish; otherwise, only "A" and "The" will be moved/removed.

I'm a bit confused about how to use other prefixes with this tip (in Facets)

I've tried : $meta_branch_swapprefix(album artist,a,dj,la,le,les,the,die) with no results.

Can someone help with the correct formatting?

Allow me to apologize because at the time I posted that, I failed to specify that this can only be achieved with Columns UI. Hope I didn't cause you to spin your wheels too much.

QUOTE (mjm716 @ Nov 21 2012, 11:14) *
Also to BenB's 2nd point - is there a way to add other prefixes to Facets filtering (e.g. a,dj,la,le,les,die)

No.


The use of these:
QUOTE
$meta_branch_stripprefix(tag)
$meta_branch_swapprefix(tag)
$meta_branch_remap_stripprefix(tag)
$meta_branch_remap_swapprefix(tag)

is fairly limited in Facets.

My suggestion to anyone wanting to swap/strip prefixes in Facets (and Columns UI for that matter) is to use %albumartistsortorder%, %albumsortorder%, %artistsortorder%, %composersortorder% and/or %titlesortorder% tags formatted as to how you want their contents to sort/display. It's relatively easy to populate these tags from the %album artist%, %album%, %artist%, %composer% and %title% tags, respectively, with prefixes swapped/stripped (or even first and last names reversed). I suggest that if you go this route that you format these tags in all of your files regardless of whether they differ (e.g. artist and artistsortorder will have the same exact content). It keeps your title formatting clean and simple.






--------------------
This signature apparently isn't too long.
Go to the top of the page
+Quote Post
mjm716
post Nov 30 2012, 14:25
Post #9





Group: Members
Posts: 82
Joined: 27-May 10
Member No.: 80935



QUOTE (BenB @ Nov 21 2012, 20:25) *
My suggestion to anyone wanting to swap/strip prefixes in Facets (and Columns UI for that matter) is to use %albumartistsortorder%, %albumsortorder%, %artistsortorder%, %composersortorder% and/or %titlesortorder%


I refuse to add a tag to my files simply for display reasons, not to mention, doing so seems very ANTI-foobar? blink.gif

It's very annoying that even when trying to use a title formatting solution, by manually stripping prefixes**, the fields are still separated without applying title formatting changes. crying.gif

Currently I use Album Artist for compilations as well as special artist name changes, so it has an important organization function, but additionally can reduce clutter in the Artist lists (in facets or elsewhere).
When I end up having multiples of the same artist name (in different order no less) just because I use multiple fields, it really defeats the purpose.

I've seen this issue documented in the forum since around 2008, with no work around - is better multiple field handling on the dev schedule Peter or should I just give it up? huh.gif

...of course I understand what a luxury Foobar is, but we still shouldn't rest on our laurels! tongue.gif

**source edited from Tigermess

CODE
$if2($ascii($stripprefix($replace($if($or($strcmp($right($put(ArtistBezFeat,$trim($cut(%<album artist>%,$if2($strstr($replace(%<album artist>%),$char(65532)),255)))),5),', The'),$strcmp($right($get(ArtistBezFeat),5),', Les'),$strcmp($right($get(ArtistBezFeat),5),', Los'),$strcmp($right($get(ArtistBezFeat),5),', Der'),$strcmp($right($get(ArtistBezFeat),5),', Die'),$strcmp($right($get(ArtistBezFeat),5),', Das')),$cut($get(ArtistBezFeat),$sub($len($get(ArtistBezFeat)),5)),$if($or($strcmp($right($get(ArtistBezFeat),4),', dj'),$strcmp($right($get(ArtistBezFeat),4),', mc'),$strcmp($right($get(ArtistBezFeat),4),', Le'),$strcmp($right($get(ArtistBezFeat),4),', La')),$cut($get(ArtistBezFeat),$sub($len($get(ArtistBezFeat)),4)),$if($strcmp($right($get(ArtistBezFeat),3),', A'),$cut($get(ArtistBezFeat),$sub($len($get(ArtistBezFeat)),3)),$get(ArtistBezFeat)))),' and ',' & ',' meets ',' & ',' with ',' & ',+,&,' vs.',' &',' vs ',' & ',' presents ',' > ',' pres.',' >',' ps.',' >',', The ',' ','& The ','& ','vs. The ','& ',', A ',' ',', dj ',' ',', mc ',' ',' dj ',' ',' mc ',' ',.,),The,A,dj,mc,Les,Los,Der,Die,Das,Le,La)),<unknown artist>)
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: 21st May 2013 - 22:41