Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returned number of search items do not match the count attribute of the class #126

Open
veljanin opened this issue Feb 27, 2023 · 2 comments

Comments

@veljanin
Copy link

veljanin commented Feb 27, 2023

Hi everyone!

I've noticed that the number of returned results from the search function doesn't match the count attribute of the class.
For example, the following code:

import discogs_client

client= discogs_client.Client(use_agent="USER_AGENT", user_token="USER_TOKEN")
results = client.search("Daft Punk One more time", type="master")
search_results_dicts = [result.data for result in results]

print(results.count == len(search_results_dicts))
print(results.count)
print(len(search_results_dicts))

would return:

>>> False
>>> 82
>>> 80

Interestingly, if you actually go to the Discogs webpage (in this case, that would be: https://www.discogs.com/search/?q=Daft+Punk+One+more+time&type=master) you will notice that the count specified is indeed 82 but if you count the items, you would only get to 80.
On the first page, you will see 1 out of 50 although there are only 48 items (6 items per row in 8 rows on PC) and the second one that has 32 items (from 51 to 82) and with the correct count.
Therefore, I believe that this comes from the Discogs API rather than the package itself.

Hope this help with further development!

@JOJ0
Copy link
Contributor

JOJ0 commented Mar 5, 2023

Hi and thanks for the detailed report. That is indeed very interesing 😮

To confirm your assumption that this is returned by api.discogs.com already, have you tried using a low level tool like curl and compared with that result as well?

@JensDollenbacher
Copy link

I have observed the same behaviour with object Master. Calling the "refresh" method makes the missing data (artists) available and solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants