Skip to content

[Bug]: MPRIS commands are ignored for radio stations (hasData() requires mpris:length) #2304

Description

@yepeekai

I have already checked through the existing (both open AND closed) bug reports and found no duplicates

  • Yes

App Version

1.15.1

Music Server and Version

Navidrome 0.63.2

What local environments are you seeing the problem on?

No response

What happened?

On Linux, every MPRIS command (PlayPause, Play, Pause, Next, Previous) is silently dropped while an internet radio station is playing. The same commands work for library tracks. This affects media keys (gsd-media-keys), playerctl, Waybar and any other MPRIS client.

Cause — in mpris.ts, all handlers are gated by hasData(), which requires a track length:

const hasData = () => {
    return mprisPlayer.metadata && !!mprisPlayer.metadata['mpris:length'];
};

mprisPlayer.on('playpause', () => {
    if (!hasData()) return;   // <-- radio never gets past this
    getMainWindow()?.webContents.send('renderer-player-play-pause');
    ...
});

Since the fix for #1586, radio metadata is published through the song._serverId === '' branch, which sets only mpris:trackid, xesam:album, xesam:artist and xesam:titleno mpris:length, because a stream has no duration. So hasData() is always false for a radio station and the command never reaches the renderer.

Verified on 1.15.1 (AppImage, Ubuntu 26.04, GNOME/Wayland), while a station was playing:

$ gdbus call --session --dest org.mpris.MediaPlayer2.Feishin \
      --object-path /org/mpris/MediaPlayer2 \
      --method org.mpris.MediaPlayer2.Player.PlayPause
()
$ gdbus call --session --dest org.mpris.MediaPlayer2.Feishin \
      --object-path /org/mpris/MediaPlayer2 \
      --method org.freedesktop.DBus.Properties.Get \
      org.mpris.MediaPlayer2.Player PlaybackStatus
(<'Playing'>,)          # unchanged — the command was dropped

Published metadata at that moment:

{'mpris:trackid': objectpath '/org/node/mediaplayer/Feishin/track/radio',
 'xesam:album': '181 BUZZ', 'xesam:artist': ['The Strokes'], 'xesam:title': 'Going Shopping'}

Suggested fix — gate on the track id rather than on a duration:

const hasData = () => {
    return mprisPlayer.metadata && !!mprisPlayer.metadata['mpris:trackid'];
};

This preserves the "nothing is loaded" guard — update-song sets mprisPlayer.metadata = {} when there is no song — while letting radio commands through.

Note: this fix alone is not enough to make media keys work on a radio station. Once the command reaches the renderer, it is dropped a second time by a separate guard — filed separately as a companion issue (the renderer drops the same commands). Both changes are needed.

On Wayland there is no fallback: Electron's globalShortcut media keys don't work there, so MPRIS is the only path to the app.

Steps to reproduce

  1. On a Linux desktop, play any internet radio station.
  2. Press the play/pause media key — or run playerctl -p Feishin play-pause, or call org.mpris.MediaPlayer2.Player.PlayPause over D-Bus.
  3. Nothing happens: the stream keeps playing and PlaybackStatus is unchanged.
  4. Play a library track and repeat step 2: it works.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions