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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sofushn
Copy link

@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: c5d7dd6

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
2 participants