Giter Site home page Giter Site logo

Comments (5)

Inzaniity avatar Inzaniity commented on July 4, 2024

Technically this can be done. The issue is, that every time a song request is made I'd have to fetch the entire playlist again and again to compare. This adds slight processing time and can put a strain on the rate limit. I could cache the playlist after the first iteration but then if you'd add a song to the playlist mid-stream I also need a way to manually update.

Limiting the lookup is not possible I think since it's a direct API endpoint on Spotify's end. The only thing I can do is compare the track id of the song request to the playlist and if it's not in there respond with "nope".

In theory, this sounds manageable to implement, but I can't promise. I'm currently taking a breather from the app, but I will think about it!

from songify.

parendev avatar parendev commented on July 4, 2024

Can definitely appreciate taking a break. :)

I looked into the Spotify API briefly before opening this ticket and saw the same search endpoint problem. It seemed to me that to get the playlist-constrained search Songify would need to implement the search functionality itself against a cached copy of the playlist's songs.

Since it sounds like that would need to be cached anyways, I'd think a very rudimentary search (e.g. case-normalized exact match) against the cache before falling back to the search API probably wouldn't be too bad. The playlist search functionality wouldn't exactly match Spotify's search, but I'm not sure that matters.

That said, I'm not sure how big of a problem false matches against copies of the songs outside the playlist even is. Nor how effective an exact match lookup from the cache would be. Feels a bit like a slippery slope where if exact match isn't good enough it rapidly becomes more difficult. Search is hard. Might not be worth adding in any form.

Just figured I'd share my brainstorming for if/when you revisit this. :)

from songify.

Inzaniity avatar Inzaniity commented on July 4, 2024

I wrote a first concept of this and it seems to work. It needs more testing but I think it'll be possible :)
image
image

Keep in mind that the playlist has to be one that you created.

from songify.

Inzaniity avatar Inzaniity commented on July 4, 2024

Implemented and released in v1.5.0

from songify.

parendev avatar parendev commented on July 4, 2024

Dude, I had missed the notifications for this until now. You're amazing. Thank you so much!

from songify.

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.