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
Using $swapprefix for bands that start with "*"
MisSigsFan
post Mar 7 2013, 06:23
Post #1





Group: Members
Posts: 2
Joined: 7-March 13
Member No.: 107072



I have a couple bands in my Library that start their name with an asterisk. I've tried specifying the prefix like this: $swapprefix(%artist%,a,the,*) but it doesn't work. Is there any way to make this work? I'm guessing since the asterisk doesn't have a space between it and the rest of the name, the $swapprefix code wouldn't work.

This post has been edited by MisSigsFan: Mar 7 2013, 06:25
Go to the top of the page
+Quote Post
Andreasvb
post Mar 7 2013, 08:03
Post #2





Group: Members
Posts: 1330
Joined: 6-March 04
From: Sweden
Member No.: 12509



Can you use it between " "?


--------------------
Windows 8.1 Pro x64 Media Center // foobar2000 1.3.1
Go to the top of the page
+Quote Post
Kohlrabi
post Mar 7 2013, 08:15
Post #3





Group: Super Moderator
Posts: 953
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



CODE
$swapprefix($if($stricmp($left(%artist%,1),*),$insert(%artist%, ,1),%artist%),a,the,*)
This inserts a whitespace after the asterisk, but only if the asterisk is the first character of the string, %artist% otherwise, and uses that for the evaluation of $swapprefix. I just now realized that it still adds a whitespace if the asterisk already has one, but hopefully you can solve this yourself, if it is a problem at all.

This post has been edited by Kohlrabi: Mar 7 2013, 08:21


--------------------
Audiophiles live in constant fear of jitter.
Go to the top of the page
+Quote Post
MisSigsFan
post Mar 7 2013, 19:12
Post #4





Group: Members
Posts: 2
Joined: 7-March 13
Member No.: 107072



QUOTE (Kohlrabi @ Mar 7 2013, 02:15) *
CODE
$swapprefix($if($stricmp($left(%artist%,1),*),$insert(%artist%, ,1),%artist%),a,the,*)
This inserts a whitespace after the asterisk, but only if the asterisk is the first character of the string, %artist% otherwise, and uses that for the evaluation of $swapprefix. I just now realized that it still adds a whitespace if the asterisk already has one, but hopefully you can solve this yourself, if it is a problem at all.

This worked! Thanks.
Go to the top of the page
+Quote Post
derty2
post Mar 7 2013, 19:25
Post #5





Group: Members
Posts: 559
Joined: 5-June 11
Member No.: 91257



Another way of managing names containing prefixes ——should I display prefix first? ....should I display last? ...should I remove?—— is to display all possible variations!

You have some music files from an artist known as:
QUOTE
* Wildcard


You create a multiple value <ARTIST NAME> tag string which you split using the semicolon:
QUOTE
* Wildcard; Wildcard, *; Wildcard; Band = * Wildcard


You create a Library Viewer Filter column named "Artist" and use this display syntax:
QUOTE
%<artist>%


While browsing the Library Viewer Filter column named "Artist" you will see 4 separate items listed in alphabetical order:
QUOTE
. . .
. . .
* Wildcard
. . .
. . .
Band = * Wildcard
. . .
. . .
Wildcard
. . .
. . .
Wildcard, *
. . .
. . .


In your Playlist Viewer, if you use a Grouping display string which starts with ARTIST (or ALBUM ARTIST) then choose one name/value from the ARTIST (or ALBUM ARTIST) tag.
If you use this title-formatting syntax:    $if2($meta(album artist,0),$meta(artist,0))    then your Playlist Viewer Grouping will . . . Display the ALBUM ARTIST tag string and choose the first value if there are multiple values, ELSE display the ARTIST tag and choose the first value if there are multiple values.

Therefore, when using such a display scheme for your foobar2000, it is good practice to do two things:    (1) Always create an ALBUM ARTIST tag using the string YOU prefer to see displayed in the Playlist Viewer Grouping.    (2) Always make the first value in the (multi-value) ARTIST tag the same as the ALBUM ARTIST tag.

What I described is the way I manage titles and text variations in my own foobar2000; I don't like the $swapprefix method.

P.S. -- One case where you may run into problems with this method is if you like displaying %TRACK ARTIST% tags. Therefore we DO NOT use the %TRACK ARTIST% tag, and instead, we prefix the track artist string to the track title tag string.     Example:   instead of this track title tag string: Song Number 4    we use this: * Wildcard — Song Number 4
Another way is to use the 1st value of the ARTIST tag, ie: $meta(artist,0) instead of %track artist%

This post has been edited by derty2: Mar 7 2013, 20:13
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: 20th April 2014 - 12:43