Context: Cause I hate working with strings when you can use an array
I’d like to make a script to make tags looks all the same, try to standardize how they are spelled, because when searching for “Steampunk”, most (?) apps/programs won’t return “Steam Punk”. The same goes for “Dnb”, which you can write as “Drum’n’Bass”, “Drum & Bass”, “Drum and Bass”… Yikes.
My problem is that I need to go through the
genre variable, check if one of the following is present, delete it and add the new genre. There is no simple way to verify if a value is present and delete it.
Ebm => EBM Edm => EDM Dnb => Drum and Bass Darkwave => Dark Wave Steam Punk => Steampunk Shadowrap => Shadow Rap Pop/Rock => Pop Rock Alt. Rock => Alternative Rock (Saw a lot of those on MB)
(Still trying to figure out when or when not to put a space between the two, even the official MB genre list is confused with this )
the multi variables are missing some useful functions.
For example, with my tired brain, I thought about the following:
$if($delmulti(genre,Dnb),$addmulti(genre,Drum and Bass))
Which may of may not be feasable/optimal and what not but you can discuss this that too
delmulti could be used alone, but could also return a true/false depending if the value was indeed deleted, so we can easily use that function as a condition too.
I’m thinking that this could also use a multi to look for:
$if($delmulti(genre,Dnb; Drum'n'bass),$addmulti(genre,Drum and Bass))
Now, maybe this is niche or already being worked on. I may have overlooked use cases or potential “why this isn’t a good idea”, hence this post.
I would appreciate your inputs on this matter, and if you have any tips, etc.
EDIT: Might also use a
replacemulti function of some sort.