SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Detection of opera works

Now added to SongKong

Songkong 12.4 is making quite a nice job of tagging Handel’s “Messiah” now. There’s one tweak which would be nice: SK is tagging with

WORK — Messiah, HWV 56
GROUPING — Messiah, HWV 56: Part I

It would be nice to strip the leading WORK name from the text of GROUPING as is done for TITLE and leave just “Part I”. Is there a switch for that too? (As it is, Lyrion presents this text twice, and I might guess that other servers behave similarly). This is a minor point of refinement of course!

The first track title is Messiah, HWV 56: I. Sinfony (Grave: Allegro Moderato), because it has multiple colons it is unreliable to derive from title so we use the MusicBrainz Works as available, and the MusicBrainz Works are:

  • Messiah, HWV 56: Part I
  • Messiah, HWV 56

And I think the situation is similar for many works ?

We take the Work title as is, trying to parse these further I think would just cause problems, but you could use AutoEdit task to Find and Replace as required.

You could also use Scripter, this seems to work

if(grouping.length>0 && (work.length>0) && grouping.contains(work + ':'))
{
    grouping = grouping.substring(grouping.indexOf(work)+work.length() + 1);
}

Once I have done Steps to allow multiple tasks to be run one after each other you could create a profile that automatically runs Scripter tasks after Fix Songs to make this smoother.

I was thinking the scripter too, but just using a regex replacement with a /^${grouping}/ match to the beginning of the line in ${work}. There’s no need to consider the presence of a colon separator.

If you only replace the matching Work then doesnt that mean afterwards you are left with a : at the start of the Grouping name?

e.g

: Part I

Oh, you are correct of course. In perl I would write something like

$grouping =~ s/^\Q$work\E[\s:]*//;

and check that JS supports the same or equivalent regex syntax of course.

Equivalent in Javascript

grouping = grouping.replaceFirst("^\\Q" + work + "\\E[\\s:]*", "")

image