Compare commits

..
2 Commits
Author SHA1 Message Date
Ansho Rei d77316b5b7 fix: delete covers cached before they were kept per server
Since 0.8.0 covers are cached in a directory per server. The files that
earlier versions wrote straight into the cache root were never read
again and never removed. They are now deleted once on start, in the
background; the server directories are left alone.
2026-11-04 21:35:04 +01:00
Ansho Rei 5b678d4f1c docs: say where the version shows while the controls bar is hidden
The README said the version is on every screen. Since the controls bar
can be turned off, it moves to a Version row in Settings instead.
2026-11-04 21:33:46 +01:00
6 changed files with 53 additions and 4 deletions
+12
View File
@@ -2,6 +2,18 @@
One section per version, newest first.
## v0.8.6 (2026-11-04)
### Bug fixes
- Covers cached by versions before 0.8.0 are deleted on start. They were no longer used but stayed on disk.
## v0.8.5 (2026-11-04)
### Bug fixes
- The README says where the version is shown while the controls bar is hidden: in Settings, as a Version row.
## v0.8.4 (2026-11-04)
### Bug fixes
Generated
+1 -1
View File
@@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]]
name = "remus"
version = "0.8.4"
version = "0.8.6"
dependencies = [
"anyhow",
"directories",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "remus"
version = "0.8.4"
version = "0.8.6"
edition = "2024"
license = "MIT"
+1 -1
View File
@@ -86,7 +86,7 @@ A scripted run starts fullscreen like a normal one, so it also checks that start
### Versions
Every finished ticket bumps the version, so a build on the Deck can be matched to what it contains. The running version is shown at the bottom left of every screen.
Every finished ticket bumps the version, so a build on the Deck can be matched to what it contains. The running version is shown at the bottom left of the controls bar. With Show controls bar turned off in Settings, it is listed as a Version row in Settings instead. The login screen always shows the bar.
- `make patch` for a bug fix, `make minor` for a feature, `make major` only when a breaking change has been decided.
- Before bumping, add a `## v<new> (<date>)` entry at the top of `CHANGELOG.md`, with `### Features` and `### Bug fixes` subsections (leave out an empty one), and commit it with the change. `make version` prints the current version.
@@ -20,6 +20,8 @@
</supports>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.8.6" date="2026-11-04"/>
<release version="0.8.5" date="2026-11-04"/>
<release version="0.8.4" date="2026-11-04"/>
<release version="0.8.3" date="2026-11-04"/>
<release version="0.8.2" date="2026-11-04"/>
+36 -1
View File
@@ -5,7 +5,7 @@ use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::future::Future;
use std::num::NonZeroUsize;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::sync::Arc;
use std::time::{Duration, Instant};
@@ -330,6 +330,9 @@ impl App {
{
log::warn!("cover cache disabled, cannot create {}: {e}", d.display());
}
if let Some(d) = dir.clone() {
rt.spawn_blocking(move || remove_unkeyed_covers(&d));
}
let inhibitor = Inhibitor::spawn(&rt);
let mpris = Mpris::spawn(&rt, |c| {
let _ = slint::invoke_from_event_loop(move || with_app(move |app| app.mpris_command(c)));
@@ -2795,6 +2798,22 @@ fn color(lab: Lab) -> Color {
Color::from_rgb_u8(r, g, b)
}
/// Deletes the covers that versions before 0.8.0 cached straight under
/// `root`. Covers now live in a directory per server, so files directly in
/// `root` are never read again.
fn remove_unkeyed_covers(root: &Path) {
let Ok(entries) = std::fs::read_dir(root) else { return };
let mut removed = 0;
for entry in entries.flatten() {
if entry.file_type().is_ok_and(|t| t.is_file()) && std::fs::remove_file(entry.path()).is_ok() {
removed += 1;
}
}
if removed > 0 {
log::info!("removed {removed} covers cached before covers were kept per server");
}
}
fn sanitize(id: &str) -> String {
id.chars()
.map(|c| {
@@ -2896,6 +2915,22 @@ fn join_dot<I: IntoIterator<Item = Option<String>>>(parts: I) -> String {
mod tests {
use super::*;
#[test]
fn unkeyed_covers_go_and_server_directories_stay() {
let root = std::env::temp_dir().join(format!("remus-covers-{}", std::process::id()));
let _ = std::fs::remove_dir_all(&root);
let server = root.join("u_https___host");
std::fs::create_dir_all(&server).unwrap();
std::fs::write(root.join("al-1_600"), b"old").unwrap();
std::fs::write(server.join("al-1_600"), b"new").unwrap();
remove_unkeyed_covers(&root);
assert!(!root.join("al-1_600").exists());
assert!(server.join("al-1_600").exists());
let _ = std::fs::remove_dir_all(&root);
}
fn png(pixel: [u8; 3]) -> Vec<u8> {
let img = image::RgbImage::from_pixel(8, 8, image::Rgb(pixel));
let mut out = std::io::Cursor::new(Vec::new());