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

feat: allow running without spotify #1092

Merged
merged 3 commits into from
Nov 4, 2024
Merged

Conversation

sofushn
Copy link
Contributor

@sofushn sofushn commented Sep 7, 2024

Closes #835

This PR allows muse to run without a Spotify client ID and secret.

The command will responde with 🚫 ope: Spotify is not enabled! if a user tries to query a song with a Spotify URL.

Logic changes

To allow for cases where Spotify isn't available two methods required changes.

addToQueue(): The logic for determining which source to fetch songs from has been moved to the getSongs service class in get-songs.ts. Songs are fetched through a single method named getSongs() which include the old logic from addToQueue(), all other methods in the class has been made private.

getYouTubeAndSpotifySuggestionsFor(): Has been refactored, all Spotify logic has been moved to the end of the method (fetching still happens asynchrony at the beginning).

PR also updates YoutubeAPI.search() method to return an empty array if no match is found for the search query. This allows for better error handling other places in the code.

  • I updated the changelog

@codetheweb
Copy link
Collaborator

codetheweb commented Sep 7, 2024

📦 🤖 A new release has been made for this pull request.

To play around with this PR, pull ghcr.io/museofficial/muse:pr-1092.

Images are available for x86_64 and ARM64.

Latest commit: 88f17c1

@Codixer
Copy link
Contributor

Codixer commented Oct 28, 2024

@sofushn Thanks for the PR, it currently lgtm. But to confirm something, this does still display the spotify query in the search function. Even if spotify is disabled?

@sofushn
Copy link
Contributor Author

sofushn commented Oct 28, 2024

Thanks for the PR, it currently lgtm. But to confirm something, this does still display the spotify query in the search function. Even if spotify is disabled?

@Codixer It's quite a long time since I wrote this PR, if I remember correctly I just show an error to the user if they try to search with a Spotify URL otherwise the whole Spotify part is ignored.

edit: is this what you are referring to? Have never noticed that it said Spotify there so didn't think to remove it 😅
image

@sofushn
Copy link
Contributor Author

sofushn commented Oct 28, 2024

For reference this is how the query result looks (fixed the Spotify URL prompt)
image

@Codixer
Copy link
Contributor

Codixer commented Oct 28, 2024

No worries @sofushn, I was just given access to this repo. I am going through everything to check what has been updated. What still needs to be done and so on and so forth.

@Codixer
Copy link
Contributor

Codixer commented Oct 28, 2024

For reference this is how the query result looks (fixed the Spotify URL prompt) image

Ah thanks, that's what I had to know. Will test this later today.

@Codixer Codixer self-assigned this Oct 28, 2024
@Codixer Codixer changed the base branch from master to develop November 4, 2024 12:30
@Codixer Codixer merged commit 07bfd32 into museofficial:develop Nov 4, 2024
4 checks passed
@codetheweb
Copy link
Collaborator

🚀 Released in Release v2.10.0.

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

Successfully merging this pull request may close these issues.

Allow running without Spotify
3 participants