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

Price suggestions #71

Merged
merged 2 commits into from
Jan 18, 2022
Merged

Price suggestions #71

merged 2 commits into from
Jan 18, 2022

Conversation

AnssiAhola
Copy link
Contributor

I added this API point that was missing as was pointed out in the discussion #68

Also added year property that was missing from the Master class. #67 comment
I think this fix is so small that it can be clumped with the new API. What do you think @JOJ0 or @alifhughes ?

This still needs documentation for the new API point. I'll come back to that at some point.

Also any feedback is appreciated 😄

@JOJ0
Copy link
Contributor

JOJ0 commented Dec 17, 2021

Will have a look tomorrow, I promise! Want to quickly try it out. I am sure it's fine already though :-) Very nice and useful feature! Thank you for adding! Great!

Adding the tiny change year prop to this PR is perfectly fine for me.

@JOJ0
Copy link
Contributor

JOJ0 commented Dec 21, 2021

Hi Anssi,
I shouldn't ever promise when it's coming to dates and times I guess :-))

I played around a little. Single release straight forward. Eg:

>>> release = d.release(12345)
>>> release.price_suggestions
<PriceSuggestions Price for Mint (M) is <Price 12.852941176470587 'EUR'>>

>>> release.price_suggestions.very_good_plus
<Price 8.794117647058822 'EUR'>

>>> release.price_suggestions.very_good_plus.value
8.794117647058822

What I noticed, but I think this has nothing to do with your implementation but is a general odd thing in p3dc, when I use search, I seem to find master releases and those don't have certain attributes available including the price_suggestions:

>>> results = d.search("chaos theory amon tobin")
>>> for result in results: print(result.title, result.year, result.genres)
# ...
# Loads of results, all fine.
# ...

>>> for result in results: print(result.companies)
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Master' object has no attribute 'companies'
>>>

>>> for result in results: print(result.price_suggestions)
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Master' object has no attribute 'price_suggestions'
>>>

@JOJ0
Copy link
Contributor

JOJ0 commented Dec 21, 2021

Ah ok I get it, when I do a regular search I get master releases and regular releases in my result. In that case, the very first is a master release, the one's after that are regular one's:

https://www.discogs.com/search/?q=chaos+theory+amon+tobin&type=all

So yes, that's all expected behaviour I guess. All good, I think we could merge this. Docs another time :-)

@JOJ0 JOJ0 merged commit 7b783a3 into joalla:master Jan 18, 2022
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

Successfully merging this pull request may close these issues.

3 participants