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

Add Shuffle & repeat to startup configuration file? #440

Open
mrfatboy opened this issue Apr 29, 2024 · 11 comments
Open

Add Shuffle & repeat to startup configuration file? #440

mrfatboy opened this issue Apr 29, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@mrfatboy
Copy link

Is it possible to set Shuffle and Repeat (others?) options in "app.toml" conf file?

I would like to set them both to True on start up without sending cli commands every time the Spotify player app restarts.

@mrfatboy mrfatboy added the enhancement New feature or request label Apr 29, 2024
@mrfatboy
Copy link
Author

A follow up question, currently there is a cli commands for toggling shuffle and repeat.

Can you add discrete On and Off commands? So when I send the on/off command I know exactly what state it is in.

Thanks

@mrfatboy
Copy link
Author

After experimenting with the repeat & shuffle commands I have some observations.

After I set Spotify player repeat to "context" it will get reset to off if Spotify player is restarted. However, if a new playlist is started the current repeat value is remembered. It would be good to have default settings in the app.toml file.

With regards to the shuffle command, it never gets remembered. It will always revert back to false on app restart as well as playing a new playlist (different from the repeat command). It would be good to have default settings in the app.toml file.

The current (non elegant) work around is start a playlist and toggle the shuffle. I have built a script that starts the playlist, sleep 5 seconds to give the playlist time to load then toggle the shuffle to True.

I don't know if these are Spotify limitations or Spotify_player bugs.

Please let me know what you think.

@aome510
Copy link
Owner

aome510 commented Apr 30, 2024

Can you add discrete On and Off commands? So when I send the on/off command I know exactly what state it is in.

Yes, should be easy to add one, but I will not be actively working on this project next few weeks. Open to PRs though.

@mrfatboy
Copy link
Author

Great. I look forward to the feature addition.

@aome510
Copy link
Owner

aome510 commented Apr 30, 2024

It will always revert back to false on app restart as well as playing a new playlist (different from the repeat command)

I know this as well and it's a limitation of the third-party library used for streaming (librespot-org/librespot#19). However, shuffle should be the similar to repeat when playing a new playlist as I've implemented a patch in:

// for some reasons, when starting a new playback, the integrated `spotify_player`
// client doesn't respect the initial shuffle state, so we need to manually update the state
self.shuffle(playback.shuffle_state, device_id).await?;

Not sure if that's because you control the player using CLI. What's your setup?

@mrfatboy
Copy link
Author

I built and run Spotify player on a macmini 2012 Ubuntu 22.04.

I am using your cli commands to control everything.

Is that what you are asking?

@aome510
Copy link
Owner

aome510 commented Apr 30, 2024

I built and run Spotify player on a macmini 2012 Ubuntu 22.04.

Does it run as UI or daemon?

I am using your cli commands to control everything.

Do you run CLI commands in the same machine as the daemon?

@mrfatboy
Copy link
Author

I followed the instructions to make my own binary. The binary is either run directly from terminal (testing) to bring up the gui or I have Spotify player launched at startup.

Since you brought it up I wanted to ask you a related question. If I launch spotify player from terminal it opens the gui in that terminal window. If I launch it from startup I don't get a terminal gui window. Am I doing something incorrectly? I a not running a daemon service.

@aome510
Copy link
Owner

aome510 commented May 1, 2024

If I launch it from startup I don't get a terminal gui window. Am I doing something incorrectly?

Not too familiar with this startup process, maybe you need to initiate the app with a terminal as spotify_player itself cannot spawn a terminal window. For example, IIRC, with kitty terminal, you can do it with

kitty --class floating spotify_player

@aome510
Copy link
Owner

aome510 commented May 1, 2024

Do you run CLI commands in the same machine as the daemon?

If you run the CLI in the same machine with the app/GUI, the shuffle state should be correct upon starting a new playback

@mrfatboy
Copy link
Author

mrfatboy commented May 2, 2024

Everything is run one the same machine. Anytime I run a cli command to play a playlist the shuffle gets reset to false.

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