diff --git a/CHANGELOG.md b/CHANGELOG.md
index 61e24a1..9e82d7d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,12 @@
One section per version, newest first.
+## v0.8.3 (2026-11-04)
+
+### Bug fixes
+
+- The now-playing cover, its background and the album art colours use the picture embedded in the playing track's file when it has one. Nextcloud Music gives every song of an album the album's cover, so tracks with their own art all showed the same one. Lists and the queue still show the server's cover.
+
## v0.8.2 (2026-11-04)
### Bug fixes
diff --git a/Cargo.lock b/Cargo.lock
index 08cfdbd..01e6c2b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]]
name = "remus"
-version = "0.8.2"
+version = "0.8.3"
dependencies = [
"anyhow",
"directories",
diff --git a/Cargo.toml b/Cargo.toml
index a720424..6f76e4e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "remus"
-version = "0.8.2"
+version = "0.8.3"
edition = "2024"
license = "MIT"
diff --git a/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml b/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml
index a91e83f..24ac08d 100644
--- a/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml
+++ b/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml
@@ -20,6 +20,7 @@
+
diff --git a/src/app.rs b/src/app.rs
index d8ec081..6646b63 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -211,6 +211,10 @@ struct Page {
type CoverKey = (String, u32);
+/// Prefix of the cover id for the picture embedded in a song's file, followed
+/// by the song id. Read from the stream, never asked of the server.
+const EMBEDDED: &str = "remus-embedded:";
+
struct Covers {
images: LruCache,
/// Per cover id, whatever size it was decoded at. None for a cover with
@@ -220,6 +224,11 @@ struct Covers {
prints: LruCache,
pending: HashSet,
failed: HashSet,
+ /// Per song id, the picture embedded in its file as the player read it,
+ /// None for a file without one. Some servers, such as Nextcloud Music,
+ /// give every song the album's cover id, so this is the only place a
+ /// track's own cover can come from.
+ embedded: LruCache>>,
limit: Arc,
/// Per server, under `root`, since ids are only unique within a server.
dir: Option,
@@ -286,6 +295,10 @@ pub struct App {
fade: Fade,
/// The now-playing art on screen, `None` when nothing is playing.
art_shown: Option,
+ /// The playing track started and the player has not yet said whether its
+ /// file has a picture: the art and palette wait, so they do not show the
+ /// album cover and then change again.
+ art_waiting: bool,
/// Runs while the cover turns away; the new art goes up when it fires.
flip_timer: Timer,
}
@@ -343,6 +356,7 @@ impl App {
prints: LruCache::new(NonZeroUsize::new(400).unwrap()),
pending: HashSet::new(),
failed: HashSet::new(),
+ embedded: LruCache::new(NonZeroUsize::new(16).unwrap()),
limit: Arc::new(Semaphore::new(6)),
dir: None,
root: dir,
@@ -366,6 +380,7 @@ impl App {
volume_timer: Timer::default(),
volume_save_timer: Timer::default(),
art_shown: None,
+ art_waiting: false,
flip_timer: Timer::default(),
prompts: Prompts::Keyboard,
icons: RefCell::default(),
@@ -561,6 +576,7 @@ impl App {
self.covers.prints.clear();
self.covers.pending.clear();
self.covers.failed.clear();
+ self.covers.embedded.clear();
for stack in &mut self.stacks {
stack.clear();
}
@@ -1235,11 +1251,10 @@ impl App {
if !self.settings.album_art_colours {
return Some(Palette::brand());
}
- let Some(id) = self
- .current
- .and_then(|i| self.queue.get(i))
- .and_then(|s| s.cover_art.clone())
- else {
+ if self.art_waiting {
+ return None;
+ }
+ let Some(id) = self.playing_cover_id() else {
return Some(Palette::brand());
};
match self.covers.tones.get(&id) {
@@ -1801,6 +1816,20 @@ impl App {
if self.covers.pending.contains(&key) || self.covers.failed.contains(&key) {
return None;
}
+ let generation = self.covers.generation;
+ if let Some(song) = id.strip_prefix(EMBEDDED) {
+ let bytes = self.covers.embedded.get(song).cloned().flatten()?;
+ self.covers.pending.insert(key.clone());
+ self.spawn(
+ async move { tokio::task::spawn_blocking(move || decode_cover(&bytes, px)).await? },
+ move |app, r| {
+ if app.covers.generation == generation {
+ app.cover_loaded(key, r);
+ }
+ },
+ );
+ return None;
+ }
let client = self.client.clone()?;
self.covers.pending.insert(key.clone());
let limit = self.covers.limit.clone();
@@ -1810,7 +1839,6 @@ impl App {
.as_ref()
.map(|d| d.join(format!("{}_{px}", sanitize(id))));
let id = id.to_string();
- let generation = self.covers.generation;
self.spawn(
async move {
let _permit = limit.acquire_owned().await?;
@@ -1853,11 +1881,11 @@ impl App {
Err(e) => {
log::debug!("cover {} failed: {e:#}", key.0);
// The playing track's art may be waiting on this to flip.
- let playing = self
- .current
- .and_then(|i| self.queue.get(i))
- .and_then(|s| s.cover_art.as_deref())
- == Some(key.0.as_str());
+ let playing = self.playing_cover_id().as_deref() == Some(key.0.as_str());
+ // A picture in the file that will not decode: the album cover then.
+ if let Some(song) = key.0.strip_prefix(EMBEDDED) {
+ self.covers.embedded.put(song.to_string(), None);
+ }
self.covers.failed.insert(key);
if playing {
self.render_player();
@@ -1897,12 +1925,7 @@ impl App {
{
self.render_page_header();
}
- if self
- .current
- .and_then(|i| self.queue.get(i))
- .and_then(|s| s.cover_art.as_deref())
- == Some(id)
- {
+ if self.playing_cover_id().as_deref() == Some(id) {
self.render_player();
}
let (qlo, qhi) = self.queue_range;
@@ -2032,6 +2055,8 @@ impl App {
// new play: another queue started there, or the track replayed.
let t = t.filter(|&i| i < self.queue.len());
self.current = t;
+ // A file already read needs no wait: replayed, or skipped back to.
+ self.art_waiting = t.is_some_and(|i| !self.covers.embedded.contains(&self.queue[i].id));
self.position = 0.0;
self.scrobbled = false;
if let Some((i, _)) = self.restoring.take()
@@ -2055,6 +2080,29 @@ impl App {
self.sync_queue(true);
self.save_queue();
}
+ PlayerEvent::Art(i, bytes) => {
+ if self.current != Some(i) {
+ return;
+ }
+ let Some(song) = self.queue.get(i).map(|s| s.id.clone()) else {
+ return;
+ };
+ log::debug!(
+ "track {song}: {}",
+ if bytes.is_some() {
+ "picture in the file"
+ } else {
+ "no picture in the file"
+ }
+ );
+ // A late picture does not undo one already read.
+ if bytes.is_some() || !self.covers.embedded.contains(&song) {
+ self.covers.embedded.put(song, bytes.map(Arc::from));
+ }
+ self.art_waiting = false;
+ self.render_player();
+ return;
+ }
}
self.sync_inhibit();
self.sync_mpris();
@@ -2247,8 +2295,9 @@ impl App {
/// from the one on screen. While a changed track's cover loads, the old one
/// stays up: the load ends in a render either way, and decides then.
fn update_art(&mut self, s: &Song) {
- if self.flip_timer.running() {
- // Mid-turn: the midpoint puts up whatever is current then.
+ if self.flip_timer.running() || self.art_waiting {
+ // Mid-turn: the midpoint puts up whatever is current then. Waiting
+ // on the player: its answer ends in a render.
return;
}
let Some(shown) = &self.art_shown else {
@@ -2256,7 +2305,7 @@ impl App {
self.render_art(s);
return;
};
- if shown.id == s.cover_art || self.screen != Screen::NowPlaying {
+ if shown.id == self.cover_id(s) || self.screen != Screen::NowPlaying {
self.render_art(s);
return;
}
@@ -2275,10 +2324,10 @@ impl App {
/// The picture the song's art will show: `Some(None)` for the placeholder,
/// `None` while its cover is still loading.
fn art_print(&mut self, s: &Song) -> Option