Help - Search - Members - Calendar
Full Version: Masstagger: Are functions possible?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
Demogorgo
Is there a way to make some kind of global functions for masstagger? I have a lot of complexity and redundancy in my tagging scripts. I have attached a screenshot for an example.

IPB Image

My scripts are very tedious to manage right now. It's mostly due to the formatting that I do to each field after scanning from filenames. If it's not possible to use custom functions, is it at least possible to combine those replace() calls?
gfngfgf
^ yes to your last question. Something like:

CODE
$replace(%artist%,_, ,;,:,etc...)

should work fine.
wraithdu
To be more generic, the wiki explains the $replace() function well -

$replace(a,b,c)

Replaces all occurrences of string b in string a with string c.

Can also be used with an arbitrary number of arguments. Note that $replace(a,b1,c1,b2,c2) is generally not the same as $replace($replace(a,b1,c1),b2,c2).

Example: $replace(ab,a,b,b,c) → "bc", $replace($replace(ab,a,b),b,c) → "cc"
Demogorgo
Thanks for explaining that function in detail. I did read the title formatting document, but didn't see the full useage of $replace. It would be great to have global functions, but now I can reduce 12 lines to 3 and just copy the smaller templates around. Thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.