aknorw/discojs

Is there a way to get all the items in my collection

Closed this issue · 5 comments

Hi, I tried going through the documentation but only found a way to get my "All" folder and seller inventory. Is there a way to get the records in my collection?

Hi,
It's possible to achieve what you want with the API, but unfortunately I didn't implement (yet) some functions that are required to achieve this with discojs. Will definitely add the missing parts asap.

Here's the code that should work once the changes are made :

client.getIdentity()
  .then(({ username }) => {
    client.listFoldersForUser(username)
      .then(({ folders }) => {
        const allFolder = folders.find(folder => folder.name === 'All')
        client.getReleasesInFolder(username, allFolder.id) // Not yet implemented
          .then((releases) => {
            // ...
          })
      })
  })

Thanks for catching this !

Cool, if you want I can also take a look at it and create a PR?

That would be great, but I have to (re)work a little on the project before :

  • Update dependencies
  • Check Discogs API first as they introduced new endpoints since I published this project (eg. exports)
    I think I will be able to do this by the end of the week, I'll let you know.
    Thanks again.

Hi,
Just updated the library to include the method getItemsInFolderForUser.
I'm closing this issue, let me know if you're having trouble.
Cheers,
Antoine

Nice!