[GH-ISSUE #188] spotify_player process launched without streaming feature installed #1033

Closed
opened 2026-03-14 13:05:57 +03:00 by kerem · 2 comments
Owner

Originally created by @flexwie on GitHub (May 5, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/188

Describe the bug
I installed spotify-player without the streaming feature enabled as I plan to use a separate spotifyd instance.
Yet once I open spotify_player it also spawns a spotify_player process.
This is annoying because it moves the focus from the terminal and pollutes the dock on MacOS.

To Reproduce
Install with cargo install spotify_player --no-default-features --features image,media-control

Expected behavior
The TUI opens and nothing more. Spotifyd or any other device that was set in config is used for playback.

Log and backtrace


2023-05-05T11:22:32.105033Z  INFO spotify_player::state: General configurations: AppConfig { theme: "dracula", client_id: "8f03b7ae0a8a45bf9d7a666dd79d9a6d", copy_command: Command { command: "pbcopy", args: [] }, playback_format: "{track} • {artists}\n{album}\n{metadata}", proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, cover_image_refresh_duration_in_ms: 2000, page_size_in_rows: 20, track_table_item_max_len: 32, play_icon: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Plain, progress_bar_type: Rectangle, playback_window_position: Top, cover_img_length: 9, cover_img_width: 5, cover_img_scale: 1.0, playback_window_width: 6, enable_media_control: true, enable_cover_image_cache: true, default_device: "spotifyd", device: DeviceConfig { name: "spotify-player", device_type: "speaker", volume: 50, bitrate: 160, audio_cache: false } }
2023-05-05T11:22:32.105152Z  WARN spotify_player::config::theme: Failed to open the theme config file (path="/Users/flexwie/.config/spotify-player/theme.toml"): No such file or directory (os error 2). Use the default configurations instead
2023-05-05T11:22:32.105185Z  INFO spotify_player::state: Theme configurations: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: LightBlue }, cyan: Color { color: LightCyan }, green: Color { color: LightGreen }, magenta: Color { color: LightMagenta }, red: Color { color: LightRed }, white: Color { color: Gray }, yellow: Color { color: LightYellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: Red }, bright_magenta: Color { color: Magenta }, bright_green: Color { color: Green }, bright_cyan: Color { color: Cyan }, bright_blue: Color { color: Blue }, bright_yellow: Color { color: Yellow } }, component_style: ComponentStyle { block_title: None, border: None, playback_track: None, playback_artists: None, playback_album: None, playback_metadata: None, playback_progress_bar: None, current_playing: None, page_desc: None, table_header: None, selection: None } }] }
2023-05-05T11:22:32.105218Z  WARN spotify_player::config::keymap: Failed to open the keymap config file (path="/Users/flexwie/.config/spotify-player/keymap.toml"): No such file or directory (os error 2). Use the default configurations instead
# keymap and token omitted
2023-05-05T11:22:32.749790Z  INFO spotify_player::media_control: Initializing application's media control event watcher...
2023-05-05T11:22:32.934334Z  INFO client_request{request=GetUserSavedAlbums}: spotify_player::client: successfully handled the client request, took: 184ms
2023-05-05T11:22:32.937609Z  INFO client_request{request=GetCurrentUser}: spotify_player::client: successfully handled the client request, took: 187ms
2023-05-05T11:22:32.939712Z  INFO client_request{request=GetUserFollowedArtists}: spotify_player::client: successfully handled the client request, took: 190ms
2023-05-05T11:22:32.988457Z  INFO client_request{request=GetUserSavedTracks}: spotify_player::client: successfully handled the client request, took: 238ms
2023-05-05T11:22:33.015475Z  INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: successfully handled the client request, took: 265ms
2023-05-05T11:22:33.016121Z  INFO client_request{request=GetUserPlaylists}: spotify_player::client: successfully handled the client request, took: 266ms
2023-05-05T11:22:58.039584Z  INFO client_request{request=GetDevices}: spotify_player::client: successfully handled the client request, took: 86ms
2023-05-05T11:23:00.559379Z  INFO client_request{request=Player(TransferPlayback("61593069c8b992ea40fb118d657298193a0f3702", false))}: spotify_player::client: Transfered the playback to device with 61593069c8b992ea40fb118d657298193a0f3702 id
2023-05-05T11:23:00.559568Z  INFO client_request{request=Player(TransferPlayback("61593069c8b992ea40fb118d657298193a0f3702", false))}: spotify_player::client: successfully handled the client request, took: 357ms
2023-05-05T11:23:01.998180Z  INFO spotify_player::media_control: Got a media control event: Toggle
2023-05-05T11:23:02.128483Z  INFO client_request{request=Player(ResumePause)}: spotify_player::client: successfully handled the client request, took: 130ms
2023-05-05T11:23:05.074254Z  INFO spotify_player::media_control: Got a media control event: Toggle
2023-05-05T11:23:05.182131Z  INFO client_request{request=Player(ResumePause)}: spotify_player::client: successfully handled the client request, took: 107ms

Environment

  • OS: MacOS 13.3.1
  • Application version: latest
  • Application features: --no-default-features --features image,media-control
Originally created by @flexwie on GitHub (May 5, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/188 **Describe the bug** I installed spotify-player without the streaming feature enabled as I plan to use a separate spotifyd instance. Yet once I open `spotify_player` it also spawns a `spotify_player` process. This is annoying because it moves the focus from the terminal and pollutes the dock on MacOS. **To Reproduce** Install with `cargo install spotify_player --no-default-features --features image,media-control` **Expected behavior** The TUI opens and nothing more. Spotifyd or any other device that was set in config is used for playback. **Log and backtrace** ``` 2023-05-05T11:22:32.105033Z INFO spotify_player::state: General configurations: AppConfig { theme: "dracula", client_id: "8f03b7ae0a8a45bf9d7a666dd79d9a6d", copy_command: Command { command: "pbcopy", args: [] }, playback_format: "{track} • {artists}\n{album}\n{metadata}", proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, cover_image_refresh_duration_in_ms: 2000, page_size_in_rows: 20, track_table_item_max_len: 32, play_icon: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Plain, progress_bar_type: Rectangle, playback_window_position: Top, cover_img_length: 9, cover_img_width: 5, cover_img_scale: 1.0, playback_window_width: 6, enable_media_control: true, enable_cover_image_cache: true, default_device: "spotifyd", device: DeviceConfig { name: "spotify-player", device_type: "speaker", volume: 50, bitrate: 160, audio_cache: false } } 2023-05-05T11:22:32.105152Z WARN spotify_player::config::theme: Failed to open the theme config file (path="/Users/flexwie/.config/spotify-player/theme.toml"): No such file or directory (os error 2). Use the default configurations instead 2023-05-05T11:22:32.105185Z INFO spotify_player::state: Theme configurations: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: LightBlue }, cyan: Color { color: LightCyan }, green: Color { color: LightGreen }, magenta: Color { color: LightMagenta }, red: Color { color: LightRed }, white: Color { color: Gray }, yellow: Color { color: LightYellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: Red }, bright_magenta: Color { color: Magenta }, bright_green: Color { color: Green }, bright_cyan: Color { color: Cyan }, bright_blue: Color { color: Blue }, bright_yellow: Color { color: Yellow } }, component_style: ComponentStyle { block_title: None, border: None, playback_track: None, playback_artists: None, playback_album: None, playback_metadata: None, playback_progress_bar: None, current_playing: None, page_desc: None, table_header: None, selection: None } }] } 2023-05-05T11:22:32.105218Z WARN spotify_player::config::keymap: Failed to open the keymap config file (path="/Users/flexwie/.config/spotify-player/keymap.toml"): No such file or directory (os error 2). Use the default configurations instead # keymap and token omitted 2023-05-05T11:22:32.749790Z INFO spotify_player::media_control: Initializing application's media control event watcher... 2023-05-05T11:22:32.934334Z INFO client_request{request=GetUserSavedAlbums}: spotify_player::client: successfully handled the client request, took: 184ms 2023-05-05T11:22:32.937609Z INFO client_request{request=GetCurrentUser}: spotify_player::client: successfully handled the client request, took: 187ms 2023-05-05T11:22:32.939712Z INFO client_request{request=GetUserFollowedArtists}: spotify_player::client: successfully handled the client request, took: 190ms 2023-05-05T11:22:32.988457Z INFO client_request{request=GetUserSavedTracks}: spotify_player::client: successfully handled the client request, took: 238ms 2023-05-05T11:22:33.015475Z INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: successfully handled the client request, took: 265ms 2023-05-05T11:22:33.016121Z INFO client_request{request=GetUserPlaylists}: spotify_player::client: successfully handled the client request, took: 266ms 2023-05-05T11:22:58.039584Z INFO client_request{request=GetDevices}: spotify_player::client: successfully handled the client request, took: 86ms 2023-05-05T11:23:00.559379Z INFO client_request{request=Player(TransferPlayback("61593069c8b992ea40fb118d657298193a0f3702", false))}: spotify_player::client: Transfered the playback to device with 61593069c8b992ea40fb118d657298193a0f3702 id 2023-05-05T11:23:00.559568Z INFO client_request{request=Player(TransferPlayback("61593069c8b992ea40fb118d657298193a0f3702", false))}: spotify_player::client: successfully handled the client request, took: 357ms 2023-05-05T11:23:01.998180Z INFO spotify_player::media_control: Got a media control event: Toggle 2023-05-05T11:23:02.128483Z INFO client_request{request=Player(ResumePause)}: spotify_player::client: successfully handled the client request, took: 130ms 2023-05-05T11:23:05.074254Z INFO spotify_player::media_control: Got a media control event: Toggle 2023-05-05T11:23:05.182131Z INFO client_request{request=Player(ResumePause)}: spotify_player::client: successfully handled the client request, took: 107ms ``` **Environment** - OS: MacOS 13.3.1 - Application version: latest - Application features: `--no-default-features --features image,media-control`
kerem 2026-03-14 13:05:57 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@aome510 commented on GitHub (May 5, 2023):

This behaviour is expected as macos/windows need an openning window to listen to media events. Disabling media-control feature should not spawn a window on startup.

Quote from the config document (https://github.com/aome510/spotify-player/blob/master/docs/config.md#media-control):

MacOS and Windows require an open window to listen to OS media event. As a result, spotify_player needs to spawn an invisible window on startup, which may steal focus from the running terminal. To interact with spotify_player, which is run on the terminal, user will need to re-focus the terminal. Because of this extra re-focus step, the media control support is disabled by default on MacOS and Windows to avoid possible confusion for first-time users.

<!-- gh-comment-id:1536375680 --> @aome510 commented on GitHub (May 5, 2023): This behaviour is expected as macos/windows need an openning window to listen to media events. Disabling `media-control` feature should not spawn a window on startup. Quote from the config document (https://github.com/aome510/spotify-player/blob/master/docs/config.md#media-control): > MacOS and Windows require an open window to listen to OS media event. As a result, spotify_player needs to spawn an invisible window on startup, which may steal focus from the running terminal. To interact with spotify_player, which is run on the terminal, user will need to re-focus the terminal. Because of this extra re-focus step, the media control support is disabled by default on MacOS and Windows to avoid possible confusion for first-time users.
Author
Owner

@flexwie commented on GitHub (May 8, 2023):

Thanks for pointing that out, I completely missed that part of the documentation

<!-- gh-comment-id:1537948454 --> @flexwie commented on GitHub (May 8, 2023): Thanks for pointing that out, I completely missed that part of the documentation
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#1033
No description provided.