GNOME Bugzilla – Bug 579093
Disc number parsing fails sometimes
Last modified: 2021-05-17 16:02:48 UTC
Please describe the problem: A fairly lengthy thread about the problem: http://musicbrainz.org/show/edit/?editid=10382208 Steps to reproduce: 1. Get a CD from a set with a long title 2. Insert CD 3. Observe metadata lookup Actual results: Sometimes the disc number is parsed, sometimes not. Expected results: consistency Does this happen every time? no Other information: http://musicbrainz.org/show/edit/?editid=10382208
For ease of future bug reading, the album title is: Concertos for Harpsichord, Violin, Flute, Oboe d'amore (The English Concert feat. harpsichord: Trevor Pinnock) (disc 5) I guess this has nothing to do with the length but the extra brackets are confusing the regex. You say "observe metadata lookup" but unless I have the same album that you do (which I don't) I cannot observe the same problem. What happens when your SJ parses the disc number of this album?
I personally have not reproduced it, as I do not own the CD. According to the reports on the musicbrainz page, the regex parsing the disc number from "(disc n)" in musicbrain titles fails intermittently. The details may not be visible unless you are logged into musicbrainz - there is a 20 post long thread about it- just in case you don't see it, I've put it on pastebin - http://pastebin.com/m11fc0df4
This is a bug that annoyed me immensely. As I mention in the musicbrainz thread above, a fix is to replace line 421 in sj-metadata-musicbrainz.c . It reads album->title = g_strdup (data); and should read album->title = g_strndup (data, 512); Maybe a slightly smaller number than 512 would suffice, but memory is cheap. I have not studied the code enough to understand why the regexp library fails to properly process the string if it has been copied with g_strdup and not g_strndup.
Is it still happening with the switch to libmusicbrainz4/libmusicbrainz5? We should no longer need magic regexp to detect multiple discs with these releases.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/sound-juicer/-/issues/115.