ricbra / php-discogs-api

PHP 5.4 Implementation of the Discogs API
MIT License
152 stars 95 forks source link

Added 3 more api-requests for folder management #37

Open psyray opened 8 years ago

psyray commented 8 years ago

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

ricbra commented 8 years ago

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.

psyray commented 8 years ago

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 ;)

ricbra commented 8 years ago

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.