Deduplicate media across scrapes and polish the viewer controls

This commit is contained in:
Fisto
2026-09-16 13:05:31 +02:00
parent 1b5fcfed2f
commit d3f9d20190
12 changed files with 198 additions and 85 deletions
+4 -2
View File
@@ -103,7 +103,7 @@ void (async () => {
attachments: [
attachment({ filename: "cat.png", contentType: "image/png" }),
attachment({ filename: "loop.gif" }),
attachment({ filename: "clip.mp4", contentType: "video/mp4", size: 1234 }),
attachment({ filename: "clip.mp4", contentType: "video/mp4", size: 1234, durationSecs: 0 }),
attachment({ filename: "note.ogg", durationSecs: 3.2 })
],
embeds: [
@@ -143,6 +143,7 @@ void (async () => {
assert.equal(items.find(item => item.url.endsWith("/stickers/55.gif"))?.kind, "gif");
assert.equal(items.some(item => item.url.includes("lottie")), false);
assert.equal(items.find(item => item.kind === "audio")?.durationSecs, 3.2);
assert.equal(items.find(item => item.url.endsWith("clip.mp4"))?.durationSecs, null);
});
await test("extract finds media in forwarded snapshots", () => {
@@ -491,7 +492,7 @@ void (async () => {
random: () => 0,
log: () => {},
previews: false,
probe: async () => ({ width: 1080, height: 1920 }),
probe: async () => ({ width: 1080, height: 1920, durationSecs: 12.3 }),
download: {
fetchImpl: async () =>
new Response("png-bytes", { status: 200, headers: { "content-type": "image/png" } }),
@@ -509,6 +510,7 @@ void (async () => {
assert.equal(row.width, 1080);
assert.equal(row.height, 1920);
assert.equal(row.aspect_ratio, 0.563);
assert.equal(row.duration_secs, 12.3);
store.close();
});