FS#13497: '0' is sometimes a valid track number

Most notably for CD rips that use a track number of 0 for
the leadin.

Therefore change our "invalid track number" canary to -1 instead
of 0.  Additionally don't try to parse an empty string.

In the process, get rid of redudant 'discnum = 0' as well.

NOTE: While not strictly necessary, we recommend rebuilding the
      database to ensure files without track numbers are
      updated with the new canary.

Change-Id: I543f98ca49cec7b5eeffa7c14c1eca57171f345a
This commit is contained in:
Solomon Peachy 2025-11-19 21:03:34 -05:00
parent 481cc70fe0
commit e94a96cdcf
15 changed files with 104 additions and 89 deletions

View file

@ -173,7 +173,7 @@ void finalize_id3(struct mp3entry *id3)
id3->codectype = mul_id3.codectype;
id3->vbr = mul_id3.vbr;
id3->discnum = 0;
id3->tracknum = 0;
id3->tracknum = -1;
id3->track_level = 0;
id3->album_level = 0;
}