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