Giter VIP home page Giter VIP logo

discogs-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gabrielcousin

discogs-client's Issues

Unable to fetch user wantlist

Hi, first of all I would like to thank you for this package. I was able to integrate very smoothly with the authentication mechanism and a great advantage is that it has defined types! However, I encountered a problem.

Issue:
The process of authenticating the user and retrieving their data using the client.getIdentity() method works fine but when I try to retrieve the wantlist using client.user().wantlist().getReleases("my_username") I get a 403 with an error:

DiscogsError: You are not allowed to view this resource. Please authenticate as the owner to view this content.

After more research, I came across this thread on the discogs forum: https://www.discogs.com/forum/thread/1032532
Looks like at some point discogs changed oauth_signature_method from PLAINTEXT to HMAC-SHA1.

When I tested this in Insomnia by setting oauth_consumer_key, oauth_consumer_secret, oauth_token_key, oauth_token_secret and oauth_signature_method to HMAC-SHA1 - everything works fine and I am able to download the wantlist for the logged-in user.

URI missing in getArtistReleases()

If I call getArtistReleases I get the list of releases, but I am missing the uri from them. I do get it if I individually call getRelease, though. So if I want to catalogue all the uris in a given discography, I would have to:

  1. Search for the artist by name (1 query)
  2. Search for the catalogue with getArtistReleases (n queries if multiple pages)
  3. Iterate over every release and search getRelease (n queries).

This is an incredibly expensive thing just to get the catalogue from an artist.

Is this a problem from the base Discogs API?

Export All TypeScript Types

Hello,

Firstly, I'd like to say thank you for this library. It's been incredibly useful in my project.

Issue:

I've noticed that not all TypeScript types are exported from the library, which makes it difficult to use certain features in a type-safe manner.

For example:

GetProfileResponse from https://github.com/lionralfs/discogs-client/blob/main/lib/user.ts
WantlistEntryResponse from https://github.com/lionralfs/discogs-client/blob/main/lib/wantlist.ts

Request:

Could you please export all the TypeScript types from the library? This includes types, type aliases, unions and any other types defined within the codebase and based on Discogs API.

Benefits:

  • Enhanced Developer Experience: Developers can more easily understand and use the library when all types are accessible, providing better IDE support and autocompletion.
  • Consistent Codebase: Allows for more consistent use of the library across different projects and teams.

Workaround:

Currently, to access the necessary types, I have to use Awaited<ReturnType<typeof T>> of my custom T method.

import apiClient from '@/service/api/apiClient'

export type DiscogsUser = Awaited<ReturnType<typeof getUser>>;
 
export const getUser = async (username: string) => {
    const user = await apiClient.user().getProfile(username);

    return user.data
}

Thank you for considering this request. I believe it will make the library even more robust and user-friendly for the community.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.