Topic: Increase number of results returned? (in VM or python)

I am writing some scripts that use python-musicbrainz-ngs to query an MB server running in a Virtual Machine.

Occasionally my query will not get the result that I really want because it's not in the first 25 results returned. I've tried setting the query command limit to 1000, like so:
result = musicbrainzngs.search_recordings(artist=a, recording=b, limit=1000)
But that still returns a maximum of 25 results. That is,
len(result['recording-list'])
equals 25, whether the limit is set to 25 or 1000 or 1000000.

I took a look through musicbrainz.py and couldn't find anything that indicated that the limit is set there. It seems pretty wide open to any number, really.

I'm going to take a wild-ass guess and think that something inside the server is set to return 25 results per page. Maybe?
If this is the case, is there a way that I can change this on my VM server?


Needing to search through many results does indicate that my search is not exact enough. Currently I am just running off the Artist Name and Recording Name as stored in the tags in the MP3s. I know that they're not always accurate, so my query results are not always accurate.

What else can I do to make my queries more accurate?

I tried using duration, but that didn't work well, and a thread in this forum indicates that searching using duration might be buggy.


I have come across some threads mentioning "MBIDs" and "fingerprints" - will they help? Can anyone point me to some more information on how/if I could programmatically use these to better match my MP3s to MB entries?

What about AcoustID? Can that be used? Does the database contain enough AcoustIDs to make that a viable option?


Thanks in advance...

2 (edited by Mineo 2012-07-28 11:50:22)

Re: Increase number of results returned? (in VM or python)

Scottes7 wrote:

I am writing some scripts that use python-musicbrainz-ngs to query an MB server running in a Virtual Machine.

Occasionally my query will not get the result that I really want because it's not in the first 25 results returned. I've tried setting the query command limit to 1000, like so:
result = musicbrainzngs.search_recordings(artist=a, recording=b, limit=1000)
But that still returns a maximum of 25 results. That is,
len(result['recording-list'])
equals 25, whether the limit is set to 25 or 1000 or 1000000.

The search documentation states that only values between 1 and 100 (inclusive) are allowed for the limit parameter. 1000 exceeds that and the server uses 25 again.

Scottes7 wrote:

I have come across some threads mentioning "MBIDs" and "fingerprints" - will they help? Can anyone point me to some more information on how/if I could programmatically use these to better match my MP3s to MB entries?

You can read more about MBIDs here - basically, they're unique identifiers for nearly everything in the MusicBrainz database. If you know the MBIDs of your songs, you can query them with python-musicbrainzngs' get_*_by_id functions, but guessing from your questions, you probably don't know them.

Scottes7 wrote:

What about AcoustID? Can that be used? Does the database contain enough AcoustIDs to make that a viable option?

That depends entirely on whether or not someone already submitted a fingerprint to the Acoustid database for your songs, so I can only suggest trying it. Acoustid also offers a webservice which you can use through python.

If all you want to do is get metadata from MusicBrainz into your files, you might as well try our own tagger, Picard.

Re: Increase number of results returned? (in VM or python)

Mineo wrote:

The search documentation states that only values between 1 and 100 (inclusive) are allowed for the limit parameter. 1000 exceeds that and the server uses 25 again.

Hmm, good point. Thanks.

But I am running against my own server in a VM. Any idea if I can change that limit to 1000?

Mineo wrote:

That depends entirely on whether or not someone already submitted a fingerprint to the Acoustid database for your songs, so I can only suggest trying it. Acoustid also offers a webservice which you can use through python.

If all you want to do is get metadata from MusicBrainz into your files, you might as well try our own tagger, Picard.

I did play with Acoustid and Picard last night. I found some things that were, to me, undesirable. I had generated Acoustids for a bunch of songs from a album that I had ripped, and used Picard for lookups. The process changed a few of the songs to different albums. That is, 10 of the songs came up in MB as being on the album that I ripped, but two of the songs were listed as being from different albums entirely. Same artist, same recording, but different releases. That is not something I'd want to change, so I'd have to figure a way around that.

Thanks for the help.

Re: Increase number of results returned? (in VM or python)

Scottes7 wrote:
Mineo wrote:

The search documentation states that only values between 1 and 100 (inclusive) are allowed for the limit parameter. 1000 exceeds that and the server uses 25 again.

Hmm, good point. Thanks.

But I am running against my own server in a VM. Any idea if I can change that limit to 1000?

The results are limited by page; not in entirety - have you tried using the offset parameter?

Re: Increase number of results returned? (in VM or python)

voiceinsideyou wrote:

The results are limited by page; not in entirety - have you tried using the offset parameter?

"Offset" was the tidbit I needed. Thanks!