How can I set the track numbers on a Vinyl release for A- and B-side separately?

That’s because of an “oops” in my scripts. I forgot that matching a file to a track will cause the scripts to be re-run.

In any event, these slightly revised scripts should take care of that:

Script 1 - Collect the information

$if($in($left(%_musicbrainz_tracknumber%,1),0123456789),
  $noop(Normal numeric track number beginning with a digit)
  $noop(Do nothing)
,
  $noop(Vinyl track number beginning with a letter)
  $noop(Increment the track count for this disc number and side)
  $set(_counter,$upper($left(%_musicbrainz_tracknumber%,1))%discnumber%)
  $if($get_a(%_counter%%tracknumber%),,
    $noop(Only increment in not already processed)
    $set_a(%_counter%,$add($if2($get_a(%_counter%),0),1))
    $set_a(%_counter%%tracknumber%,1)
  )
)

Script 2 - Apply the information

$if($in($left(%_musicbrainz_tracknumber%,1),0123456789),
  $noop(Normal numeric track number beginning with a digit)
  $noop(Do nothing)
,
  $noop(Vinyl track number beginning with a letter)
  $noop(Save the total track count for this disc number and side)
  $set(_counter,$upper($left(%_musicbrainz_tracknumber%,1))%discnumber%)
  $set(tracknumber,%_musicbrainz_tracknumber%/$get_a(%_counter%))
)

Sorry about so many iterations to get this working correctly.

2 Likes