Giter Site home page Giter Site logo

Comments (7)

freyacodes avatar freyacodes commented on July 20, 2024

This could be a thing, though it currently isn't very high on my list and I'm already really busy.

Contributions welcome.

from archived-bot.

schnapster avatar schnapster commented on July 20, 2024

Been working on this and basically it's in a functioning state. There is a problem though, the only decent Java Spotify API I found is a bit dated, and one of the things it's missing is loading more than the first page of a playlist, so currently it works only for the first 100 tracks.

For me it would mean a non-trivial amount of work to go and fix this, because it sounds like lots of stuff I haven't done yet (inb4 I'm just panicking and actually fix it in a day's time lol).

I see several paths to fix this:

  • Ditch that Spotify API and do our own few requests. For the Spotify playlist feature we need authorization + 2 kinds of requests, that's not too complicated.
  • Keep that Spotify API, somehow make the missing request from scratch in our own code
  • Fork the Spotify API, add the missing request, and publish it

I think adding and keeping the Spotify API in FredBoat would be worth it, because chances are high (this is a MusicBot, after all) we might want to do even more requests to Spotify in the future.

I feel like going with option two, and then later, if I can be assed, to do it the correct way which is option 3.

I'm planning to polish what I currently have (= only add first 100 tracks of Spotify playlists), and then go do the fix for that underlying issue.

Feel free to chip in thoughts on what to do, and whether FredBoat would want to roll out limited Spotify playlist support first and then upgrade later, or do the full thing later.

from archived-bot.

freyacodes avatar freyacodes commented on July 20, 2024

Either path works for me. I would imagine that it would be pretty simple to just fetch the full list with just a loop of REST requests in the source manager.

API documentaion:
https://developer.spotify.com/web-api/get-playlists-tracks/

from archived-bot.

schnapster avatar schnapster commented on July 20, 2024

In case you were wondering how I solved the aforementioned thing: After going on a small odyssey including using java reflection to access private methods and other nonsense I settled with the 4th option of utilizing my brain correctly and using that Spotify API properly (turned out I just needed to add parameters to its requests).

from archived-bot.

Altirix avatar Altirix commented on July 20, 2024

just to add to this. its also possible to request single tracks and albums. ive done it discord python bot so i could see if i can work it out for java (nvm looks very different from how i added the support for it in python)

from archived-bot.

schnapster avatar schnapster commented on July 20, 2024

Indeed. Could be a convenient way to access information on artists/albums/other stuff to create playlists which are then loaded over music providers.
https://developer.spotify.com/web-api/search-item/

from archived-bot.

freyacodes avatar freyacodes commented on July 20, 2024

This is now available on the development branch for selfhosted bots and the patron bot. Thanks napstr!

from archived-bot.

Related Issues (20)

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.