php-discogs-api icon indicating copy to clipboard operation
php-discogs-api copied to clipboard

Added 3 more api-requests for folder management

Open psyray opened this issue 9 years ago • 3 comments

Hi,

I added 3 API request that I use in my project to get Folders of a user collection, Folder properties of a given folder and Releases contained in a given folder

Enjoy

psyray avatar Apr 09 '16 15:04 psyray

Hi @psyray

Thanks for your PR. Could you also add unit tests for these new calls? Take a look at the other tests for an example of how to do this.

ricbra avatar Apr 11 '16 06:04 ricbra

Hi,

To use these API requests, user need to be authenticated by OAuth. To enable Oauth, HWI Oauth Bundle is needed, and an application must be registered in Discogs.

How can I manage this connection with your bundle ? Maybe we could bypass the auth by creating an account with a public collection, and then we could have access to folders. You are the owner of this repo, so I let you create it ;)

psyray avatar Apr 11 '16 06:04 psyray

Hi @psyray

In my applications I use HWIOauthBundle for the OAuth authentication (hence I even wrote the Discogs provider for the HWIOauthBundle 😉 ). I don't want any OAuth stuff in the DiscogsBundle because it has nothing to do with Discogs. It is a separate concern. Just fetch the OAuth tokens and stuff from OauthBundle and pass it in your service configuration for the Discogs client using a factory.

For the unit tests required for this PR, you should somehow log the real responses you receive from Discogs. These need to be used as mock responses for the tests. Of course, replace sensitive content in these responses with placeholders.

I hope this answers your question.

ricbra avatar Apr 12 '16 07:04 ricbra