files: video previews are made on the Transcode device too

The setting's device makes every video preview: on the file's own machine
when it is there (the hub tells it by header), else on the device's machine,
which reads the file through the hub by a one-file token, and the preview is
kept in the file's machine's own cache (PUT /api/files/thumb, refused if the
file changed). Images and covers stay on the file's machine's CPU. If the
device's machine can't, the file's makes it as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-10-23 16:07:00 -07:00
co-authored by Claude Opus 5.5
parent 1464e1f7a0
commit d5c16540a1
7 changed files with 335 additions and 12 deletions
+14
View File
@@ -155,3 +155,17 @@ func TestPieceArgs(t *testing.T) {
t.Error("no sound means -an")
}
}
func TestCapsOnly(t *testing.T) {
c := gridCaps()
if got := c.Only("/dev/dri/renderD129"); len(got.GPUs) != 1 || got.GPUs[0].Name != "Intel Arc A380" || len(c.GPUs) != 2 {
t.Fatalf("one card: %+v", got.GPUs)
}
if len(c.Only(CPU).GPUs) != 0 || len(c.Only("/dev/dri/renderD200").GPUs) != 0 || len(c.Only("").GPUs) != 2 {
t.Fatal("cpu, a device not here, any")
}
// previews then go to that card, or the CPU
if g := c.Only("/dev/dri/renderD129").pick("hevc"); g == nil || g.Device != "/dev/dri/renderD129" {
t.Fatalf("pick: %+v", g)
}
}