librespot-org / librespot

Open Source Spotify client library
MIT License
4.46k stars 540 forks source link

Support additionnal SpotifyUri types #1266

Open acolombier opened 3 months ago

acolombier commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently, only a subset of URI are supported, while some other like genre or medialistconfig aren't, which preventing deserializing data coming from certain endpoint like rootlist

Describe the solution you'd like

SpotifyId could be refactored to aligned better with the underlying core concept; this way, SpotifyId and SpotifyItemType would become SpotifyUri, and the enum would define sub part, such as SpotifyID (Spotify ID in the above doc), but not exclusively, like it is the case with the current structure.

Describe alternatives you've considered

Alternatively, I have currently extended the existing Struct/Enum relation, which allows supporting these additional URI type in a non-breaking way, but this leads to inconsistency, which is likely to grow as more URI type are added

Additional context

N/A

acolombier commented 3 months ago

Happy to help implementing the later if that is of interest

roderickvd commented 3 months ago

Sounds like a good idea. Feel free to open a PR!