SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Using Scripter to remove a single roonalbumtag, roonsongtag or grouping tag

Hi Paul

Across my collection I have a number of diffrerent roonalbumtags, roonsongtags and grouping tags and I would like to clean some of them up. They are all saved as individual tags so in songkong they look like

tag1;;;tag2;;;tag3;;;tag4

Is it possible to run through my collection and just remove tag3 (for example) from any song that contains it, while leaving the others, in either roonalbumtag; roonsongtag or grouping?

I’m not bothered if i have to do multiple runs for each of those 3 catagories.

Thanks

Hi try this, just modifying valueToRemove to what you want to remove

function deleteMatchingValues(fieldName, value)
{
   var finalValue = '';

   for(i=0; i < fieldName.length; i++)
   {
      var nextVal = fieldName[i];
      if(!nextVal.equals(value))
      {
          finalValue=finalValue + nextVal + ';;;'
      }
   }


   if(finalValue.length > 0) 
   {
      finalValue = finalValue.substring(0, finalValue.length - 3)    
   }
   return finalValue;
}

var valueToRemove = 'tag3'
roonalbumtag=deleteMatchingValues(roonalbumtag_index,valueToRemove);
roontracktag=deleteMatchingValues(roontracktag_index,valueToRemove);
grouping=deleteMatchingValues(grouping_index,valueToRemove);

That worked perfectly.

Thanks Paul

1 Like

Hi Paul

I’ve been using this script to tidy up my tags. I modify it to work with Composer or Mood or Genre for example.

Is it possible to remove more than value at the same time?

For example, say I have a load of tracks/albums with the Genre tags “Country Rock” and “Blues Rock”.
All the “Country Rock” albums also have “Country” and “Rock” Genres. And all the “Blues Rock” have “Blues” and “Rock”.
So I decide I don’t need “Country Rock” and “Blues Rock” I can just filter them.

Is it possible to modify that script so it runs over the entire library and removes “Country Rock” and/or “Blues Rock” from the Genre field while leaving all other Genres alone?

And, like above, could it be modified for other tag fields?

Many thanks