Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Limit Song Requests to Playlist #67

Closed
parendev opened this issue Jul 7, 2023 · 5 comments
Closed

Feature Request: Limit Song Requests to Playlist #67

parendev opened this issue Jul 7, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@parendev
Copy link

parendev commented Jul 7, 2023

This tool looks really promising. I'd love to use it, but do not want to allow users to request songs I don't have rights to play on stream.

Would you consider adding a setting where a streamer can provide a link to a playlist (or playlists) of stream-approved songs, which song requests could be limited to? For example: https://open.spotify.com/playlist/7sZbq8QGyMnhKPcLJvCUFD

Ideally song request lookups would be limited to that playlist as well, to avoid requests being blocked due to matching with a song outside of the playlist that happens to have the same name. But that might be more difficult.

@Inzaniity Inzaniity added the enhancement New feature or request label Jul 7, 2023
@Inzaniity
Copy link
Collaborator

Inzaniity commented Jul 7, 2023

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!

@parendev
Copy link
Author

parendev commented Jul 8, 2023

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. :)

@Inzaniity
Copy link
Collaborator

Inzaniity commented Jul 10, 2023

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.

@Inzaniity
Copy link
Collaborator

Implemented and released in v1.5.0

@parendev
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants