Re: Ratings and throttling
Ian McEwen <[email protected]> Mon, 16 Feb 2015 19:37:03 -0700
| Newsgroups | gmane.comp.audio.musicbrainz.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Feb 16, 2015 at 09:10:51AM -0800, Joe Martinez wrote: > I am developing a music application that does the following: > > 1) Encourages users to rate their songs by prompting the user to rate a > song in his/her library while it's playing, if the user has not already > rated it. > > 2) Allows the user to choose his/her desired mix of ratings (i.e. how > frequently 5-star songs play, compared to 4-star songs, etc.), as well as > what frequency of unrated songs are chosen, when shuffling or creating auto > playlists. > > I was planning on using ID3 popularimiter tags to do this directly in the > MP3 files, but I was discussing my idea with Robert Kaye awhile back, and > he recommended that I store the user ratings in MusicBrainz instead, so > that a user's ratings would be consistent across devices, and also so that > MusicBrainz could build up its aggregate rating data for the benefit of > other users. > > So, I've been working on this, and #1 is working great. > > The problem is that on #2, I am running into throttling issues. It > requires the application to query the user-rating of each song in the > user's library when the application starts, so that it will have that data > available to create the desired mix. I have been querying the ratings > using: > > /ws/2/recording/<MBID>?inc=user-ratings > > I do that query in a loop, which of course generates a lot of requests to > the server, and I quickly start getting throttling errors. If I were to > put a delay into the loop to do only 1 query per second, it would take > forever to get all the data. > > So, I'm wondering if there's a better (more efficient) way to retrieve all > of a user's ratings that wouldn't cause throttling issues. Is there maybe > an endpoint that would allow me to grab all of the authenticated user's > ratings at one time (like the musicbrainz.org/user/<USERNAME>/ratings web > page, but in XML? If not, any other ideas? > The only thing I can think of offhand is that you can get recording ratings via release requests and via recording browse requests, e.g. by artist. So if you have release tags and artist tags you may be able to get ratings for all recordings at once (or, in the case of browse requests, up to 100 at once via the limit parameter). I don't think there's a straightforward "get all ratings by X user", but this might help you some, anyway. > -Joe > _______________________________________________ > MusicBrainz-devel mailing list > [email protected] > http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel _______________________________________________ MusicBrainz-devel mailing list [email protected] http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel
signature.asc
(application/pgp-signature, 181 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTiqU8ACgkQq+0avXExp2+/3wCdEce/quNYuGsEj1Gv1zwNqU/c 4pMAniJ9Vvv2L8vMNAt4GL/dLaeJgDZr =gp31 -----END PGP SIGNATURE-----