After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764941 - Check MCN before querying detailed album metadata
Check MCN before querying detailed album metadata
Status: RESOLVED FIXED
Product: sound-juicer
Classification: Applications
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Sound Juicer Maintainers
Sound Juicer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-12 10:38 UTC by Phillip Wood
Modified: 2016-08-16 10:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check MCN before querying detailed album metadata (12.94 KB, patch)
2016-04-12 10:38 UTC, Phillip Wood
none Details | Review
Rate limit musicbrainz queries (1.67 KB, patch)
2016-08-15 12:20 UTC, Phillip Wood
committed Details | Review
Retry query if MusicBrainz is busy (3.99 KB, patch)
2016-08-15 12:20 UTC, Phillip Wood
committed Details | Review
Check MCN before querying detailed album metadata (12.64 KB, patch)
2016-08-15 12:20 UTC, Phillip Wood
committed Details | Review

Description Phillip Wood 2016-04-12 10:38:04 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.
Comment 1 Phillip Wood 2016-04-12 10:38:07 UTC
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.
Comment 2 Phillip Wood 2016-08-15 12:20:12 UTC
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
Comment 3 Phillip Wood 2016-08-15 12:20:19 UTC
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
Comment 4 Phillip Wood 2016-08-15 12:20:59 UTC
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.
Comment 5 Phillip Wood 2016-08-16 10:30:56 UTC
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