GNOME Bugzilla – Bug 764941
Check MCN before querying detailed album metadata
Last modified: 2016-08-16 10:31:07 UTC
Currently Sound Juicer queries MusicBrainz for detailed album metadata for all the releases that match the disc id in turn, stopping if it finds one where the barcode matches the MCN on the disc. This means that unless the barcode for the first release that is queried matches the MCN it is performing unnecessary queries which slows down the metadata retrieval. The query that returns the matching album id’s for the disc id also returns the barcodes so it is possible to check the barcodes against the MCN and if one matches only perform the detailed release query for that release. This speeds up getting the metadata for discs with multiple matches where the MCN matches the barcode of one of the releases.
Created attachment 325784 [details] [review] Check MCN before querying detailed album metadata Currently Sound Juicer queries MusicBrainz for detailed album metadata for all the releases that match the disc id in turn, stopping if it finds one where the barcode matches the MCN on the disc. This means that unless the barcode for the first release that is queried matches the MCN it is performing unnecessary queries which slows down the metadata retrieval. The query that returns the matching album id’s for the disc id also returns the barcodes so it is possible to check the barcodes against the MCN and if one matches only perform the detailed release query for that release. This speeds up getting the metadata for discs with multiple matches where the MCN matches the barcode of one of the releases.
Created attachment 333332 [details] [review] Rate limit musicbrainz queries Queries to MusicBraniz should be limited to one per second https://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting
Created attachment 333333 [details] [review] Retry query if MusicBrainz is busy Recently MusicBrainz has been returning error 503 for some queries when it is overloaded. This causes the lookup to fail. If it’s busy wait a while and retry the query. To avoid overloading MusicBrainz even more we limit the number of retries to 4 and wait 4 seconds for the first retry, a further 11 seconds for the second and then 30 seconds between subsequent retries. https://bugzilla.gnome.org/show_bug.cgi?id=764940
Created attachment 333334 [details] [review] Check MCN before querying detailed album metadata Currently Sound Juicer queries MusicBrainz for detailed album metadata for all the releases that match the disc id in turn, stopping if it finds one where the barcode matches the MCN on the disc. This means that unless the barcode for the first release that is queried matches the MCN it is performing unnecessary queries which slows down the metadata retrieval. The query that returns the matching album id’s for the disc id also returns the barcodes so it is possible to check the barcodes against the MCN and if one matches only perform the detailed release query for that release. This speeds up getting the metadata for discs with multiple matches where the MCN matches the barcode of one of the releases.
Attachment 333332 [details] pushed as 33db565 - Rate limit musicbrainz queries Attachment 333333 [details] pushed as 9482097 - Retry query if MusicBrainz is busy Attachment 333334 [details] pushed as 334761d - Check MCN before querying detailed album metadata