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
I want to specify a user-defined char as splitter of multi-value field, [TOS #6: moved from Support, was "Multi Value Split Character&quo
rkghadai
post Apr 19 2012, 17:53
Post #1





Group: Members
Posts: 10
Joined: 19-April 12
From: India
Member No.: 98996



I know this is a repeated topic, but i have not found the exact solution i want after surfing a dozen threads, hence posting.

In Multi-value tag fields like Genre and Artist, I want Foobar to recognize a use-defined character as the splitter. I know foobar can write multiple genre fields (by mass tagger or action), but that makes only the first genre visible when i see in windows explorer folder view. Is it possible to make foobar only read the tag as a string "A;B" and take as input the user-defined splitter ;, thus recognize both A and B as two different genres in Library view?? This behavior is available in mediamonkey, which has the option to both write multi-value tags and no-write-only-read-and-recognize the multi-value tags. I think some formatting (kind of $if,$trim, etc) could do the job in foobar as well. Plz help.

This post has been edited by rkghadai: Apr 19 2012, 17:54
Go to the top of the page
+Quote Post
Tigermess
post Apr 20 2012, 20:25
Post #2





Group: Members
Posts: 65
Joined: 28-October 11
Member No.: 94746



Sorry not really having an answer but at least basics:
1. To write non-multi-value tags deleting all items in Preferences>Advanced>Display>Properties>Multivalue Fields should help

2. To read ;-separated single values as multivalues, did you try experimenting with $meta* functions? This is the only way I can think about; not sure if that will work. There are also hackarounds like having masstager doing duplicates of all your fields - and basic like GENRE, ARTIST etc. will be single value and copies - GENRE_MULTI, ARTIST_MULTI shall contain splitted value which foobar and other capable players will use. Not really sexy but at least might be working.

Go to the top of the page
+Quote Post
rkghadai
post Apr 21 2012, 05:51
Post #3





Group: Members
Posts: 10
Joined: 19-April 12
From: India
Member No.: 98996



QUOTE (Tigermess @ Apr 21 2012, 00:55) *
To read ;-separated single values as multivalues, did you try experimenting with $meta* functions? This is the only way I can think about; not sure if that will work.



The $meta function, as the definition says in the attached image, separates existing multiple values of a tag. My case is single value tag, to be parsed into two parts. So need scripting in foobar syntax, which i can't write myself (though i can understand an already written code). Hope some foobar formatting expert could find some time for this Parsing job.
Go to the top of the page
+Quote Post
q-stankovic
post Apr 21 2012, 09:20
Post #4





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



The library viewer facets has following feature for creating columns:
QUOTE
Multiple patterns

Multiple patterns can be combined with | to display values from different fields in the same column. For example, %<artist>%|%<composer>% lists both artists and composers, which might be useful to create a list of persons regardless of their actual role.


So i thought that this could work: $replace(%genre%,;,|)
But it doesn't! On the other side an expression like %genre%|<put any text string here> will work. Maybe a request for the facets component?

This post has been edited by q-stankovic: Apr 21 2012, 09:22


--------------------
german support forum: www.foobar-users.de / user: qwert73
Go to the top of the page
+Quote Post
rkghadai
post Apr 21 2012, 18:18
Post #5





Group: Members
Posts: 10
Joined: 19-April 12
From: India
Member No.: 98996



QUOTE (q-stankovic @ Apr 21 2012, 13:50) *
Multiple patterns can be combined with | to display values from different fields in the same column. For example, %<artist>%|%<composer>% lists both artists and composers, which might be useful to create a list of persons regardless of their actual role.



I think i got it. I used the above trick and the syntax to 'Find first occurence of character X in %tag%, and return everything in front of or after X'. This is my code in preferences->medialibrary->facets->column genre:

$puts(char,;)$puts(tag,%genre%)$puts(spacer,$strchr($get(tag),$get(char)))$trim($left($get(tag),$sub($get(spacer),1)))|$puts(char,;)$puts(tag,%genre%)$puts(spacer,$strchr($get(tag),$get(char)))$trim($right($get(tag),$sub($len($get(tag)),$get(spacer))))

I am so so so happy...for having written a code :D and having removed my biggest roadblock to shifting to foobar (the other roadblock being to make foobar recognize my 'rating mm' tag).

Thank you guys for the guidance. :)

This post has been edited by rkghadai: Apr 21 2012, 18:19
Go to the top of the page
+Quote Post
q-stankovic
post Apr 21 2012, 19:00
Post #6





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



I still do wonder why my simple string leads to a blank pane in facets; in album list this little "trick" works (here | means creating a tree hierarchy)

rkghadai, your code seems to work only if there aren't more than two parts of the value.

(Edit: made a note in facets thread)

This post has been edited by q-stankovic: Apr 21 2012, 19:10


--------------------
german support forum: www.foobar-users.de / user: qwert73
Go to the top of the page
+Quote Post
rkghadai
post Apr 21 2012, 19:09
Post #7





Group: Members
Posts: 10
Joined: 19-April 12
From: India
Member No.: 98996



ya it wont work for more than two values. But 'Return everything between two characters' gives me hope that it would be possible write a code for more-than-two values.

Go to the top of the page
+Quote Post
Tigermess
post Apr 22 2012, 01:53
Post #8





Group: Members
Posts: 65
Joined: 28-October 11
Member No.: 94746



Cool string rkghadai smile.gif I have many files with genres split just by colon or slash, I will try that. Good to hear about posting facets issue further too.
Go to the top of the page
+Quote Post
rkghadai
post Apr 22 2012, 16:16
Post #9





Group: Members
Posts: 10
Joined: 19-April 12
From: India
Member No.: 98996



Still looking for a flexible code, not restricted to only two values in a tag. Probably for-loop or recursive function is required
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: 24th July 2014 - 03:34