Skip to content

Information about currently played track / context in D-Bus, socket or some other way of communication with a client #1250

Description

@ciembor

Is your feature request related to a problem? Please describe.
I'm working on a client that has to be as responsible as possible (manual knobs, button and UI on the screen of a device). Number of requests sent to API is limited and I have to send requests about current track every second to get this info and update UI.

Describe the solution you'd like
Daemon have info about current track already and uses D-Bus to notify about currently playing track / context:

            .emits_changed_false()
            .get(move |_, _| {
                if let Ok(Some(playback)) = sp_client.current_playback(None, None::<Vec<_>>) {
                    if playback.device.name == mv_device_name {
                        if playback.is_playing {
                            return Ok("Playing".to_string());
                        } else {
                            return Ok("Paused".to_string());
                        }
                    }
                }
                Ok("Stopped".to_string())
            });

But I need something more, spotify id of a track / context and type (I'm not sure here, but probably you have different types of contexts). It would be wise to not send these requests from both daemon and client.

Describe alternatives you've considered
I don't know if D-Bus isn't to narrow, sockets might be more universal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA new feature that would improve Spotifyd

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions