Read the MPRIS cover from the file when Qt leaves CoverArtImage empty #7

Merged
GrumpyStraw merged 1 commit from fix/flatpak-mpris-cover into main 2026-10-11 11:58:54 +02:00
Owner

Cover missing from the media controls in the Flatpak

The Flatpak sent no mpris:artUrl, so the Plasma Media Player widget and the lock screen showed no cover. The native build showed it.

The cover for the media controls comes from QMediaMetaData::CoverArtImage. The same song, loaded with QMediaPlayer, gives:

Qt 6.12 (Arch) Qt 6.11.2 (KDE 6.11 Flatpak runtime)
CoverArtImage 640×637 empty
ThumbnailImage 640×637 640×637

When CoverArtImage is empty, the player now reads the cover with CoverArt::read, the libavformat code the song list already uses. It picks the "Cover (front)" picture, so the media controls and the app show the same cover. ThumbnailImage would also work, but it is deprecated in Qt 6.12 and gives a build warning.

Checked: builds without warnings and the tests pass with Qt 6.12 and in org.kde.Sdk//6.11. CoverArt::read finds the front cover inside the app's sandbox, on the document portal path the app uses.

## Cover missing from the media controls in the Flatpak The Flatpak sent no `mpris:artUrl`, so the Plasma Media Player widget and the lock screen showed no cover. The native build showed it. The cover for the media controls comes from `QMediaMetaData::CoverArtImage`. The same song, loaded with `QMediaPlayer`, gives: | | Qt 6.12 (Arch) | Qt 6.11.2 (KDE 6.11 Flatpak runtime) | | --- | --- | --- | | `CoverArtImage` | 640×637 | empty | | `ThumbnailImage` | 640×637 | 640×637 | When `CoverArtImage` is empty, the player now reads the cover with `CoverArt::read`, the libavformat code the song list already uses. It picks the "Cover (front)" picture, so the media controls and the app show the same cover. `ThumbnailImage` would also work, but it is deprecated in Qt 6.12 and gives a build warning. Checked: builds without warnings and the tests pass with Qt 6.12 and in `org.kde.Sdk//6.11`. `CoverArt::read` finds the front cover inside the app's sandbox, on the document portal path the app uses.
Read the MPRIS cover from the file when Qt leaves CoverArtImage empty
All checks were successful
build / build (pull_request) Successful in 2m8s
build / release (pull_request) Has been skipped
a60d15ab18
GrumpyStraw deleted branch fix/flatpak-mpris-cover 2026-10-11 11:58:54 +02:00
Sign in to join this conversation.
No description provided.