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

added remove_release to collection folder #88

Merged

Conversation

AnssiAhola
Copy link
Contributor

@AnssiAhola AnssiAhola commented Mar 8, 2022

Implements this API as requested by @raratiru in #86
Not the most elegant solution but it works 🤷

@JOJ0 @alifhughes
If you could check this and test it, I'd appreciate it 🙂

Not sure if delete_instance is good name for the method, maybe delete_release to be consistent? Although it needs CollectionItemInstance as the instance id is required in the url.
Maybe it should be remove_release or remove_instance like @raratiru suggested?

Any suggestions are appreciated! 😅

Usage:

user = d.user("example")
folder = user.collection_folders[1]
releases = folder.releases
# Delete the first instance in releases
folder.remove_release(releases[0])

@AnssiAhola AnssiAhola self-assigned this Mar 8, 2022
@AnssiAhola AnssiAhola linked an issue Mar 8, 2022 that may be closed by this pull request
@JOJ0
Copy link
Contributor

JOJ0 commented Mar 8, 2022

I vote for add_release vs remove_release. Thanks @AnssiAhola, hope I will manage to test tomorrow or Thursday morning.

@JOJ0
Copy link
Contributor

JOJ0 commented Mar 8, 2022

What I dont understand from reading the discogs api docs you posted @AnssiAhola: It will remove the release instance from a folder, ok, but when removing from the uncategorized folder, I think the one with folder id 0, does it mean it will be removed from the collection entirely? That right? It would make sense but it's not entirely clear to me from reading the doc.

Update: Ok that was silly, we give the instance id in the url_

discogs_client/models.py Outdated Show resolved Hide resolved
@AnssiAhola AnssiAhola changed the title added delete_instance to collection folder added remove_release to collection folder Mar 9, 2022
Copy link
Contributor

@JOJ0 JOJ0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this so @raratiru can use it and do docs later on.

@raratiru
Copy link

Thank you, this is a great addition!

@AnssiAhola
Copy link
Contributor Author

@raratiru This will be merged and (hopefully) released tomorrow if everything goes to plan 🤞

@AnssiAhola AnssiAhola merged commit 5536c6a into joalla:master Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Remove release from collection
4 participants