feat(backend): immutable cache dir scheme + stale sweep

This commit is contained in:
2026-09-05 00:23:57 +08:00
parent b02ca67d16
commit 4e84a8aeb7
4 changed files with 122 additions and 0 deletions
+14
View File
@@ -77,6 +77,20 @@ func TestBooksDiffLifecycle(t *testing.T) {
}
}
func TestBookHashes(t *testing.T) {
s := setup(t)
ctx := context.Background()
libID, _ := s.CreateLibrary(ctx, "l", "/data/books/l")
bid, _ := s.InsertBook(ctx, libID, "a.cbz", "a", "cbz", 100, 2000, 1)
m, err := s.BookHashes(ctx)
if err != nil {
t.Fatal(err)
}
if v := m[bid]; v[0] != 100 || v[1] != 2000 {
t.Fatalf("bad hashes %+v", v)
}
}
func TestProgressUpsertAndJoin(t *testing.T) {
s := setup(t)
ctx := context.Background()