Fold only sidecar-only releases (sidecar_only at insert); no queue-wide scan for gone releases
Test and deploy / test (push) Successful in 47s
Test and deploy / edge (push) Successful in 1m56s
Test and deploy / deploy (push) Successful in 54s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-17 20:57:59 +02:00
1 parent aa20d6b79f
commit f2c5607ec3
6 files changed
+57 -16

No files matched your search

+13
View File
@@ -146,4 +146,17 @@ test.group('BatchStore', (group) => {
const keys = (await releasesOf()).filter((r) => r.identity_key === first.identity_key).map((r) => r.release_key)
assert.deepEqual(keys, [first.identity_key, `${first.identity_key}:3`])
})
test('a small release of sidecars only is marked for the sidecar fold', async ({ assert }) => {
await storeIn(GROUP, 1_000_000, [
...upload(1_000_000, 'Murdoch Mysteries S8D1.nzb', 1, '[00/80]', '2026-10-05T10:00:00Z'),
...upload(1_000_010, 'Some.Tool.v1.zip', 1, '[01/01]', '2026-10-05T10:00:00Z'),
...upload(1_000_020, 'Some.Show.S01E01.part01.rar', 2, '[02/30]', '2026-10-05T10:00:00Z'),
])
const flags = new Map((await db.from('releases').select('name', 'sidecar_only')).map((r) => [r.name, r.sidecar_only]))
assert.isTrue(flags.get('Murdoch Mysteries S8D1'))
assert.isFalse(flags.get('Some.Tool.v1'))
// Over 1 MB: not looked at.
assert.isNull(flags.get('Some.Show.S01E01'))
})
})
+2
View File
@@ -220,6 +220,8 @@ test.group('Par2Merger', (group) => {
// A picture isn't a sidecar; an nfo an hour later belongs to nothing here.
const picture = await release('cover', 1, null, at, ['cover.jpg'])
const late = await release('Murdoch Mysteries S8D1', 1, null, new Date(at.getTime() + 3600_000), ['Murdoch Mysteries S8D1.nfo'])
// Queued, its release gone meanwhile (merged): leaves the queue with its batch.
await db.table('fold_candidates').insert({ release_id: 987654321 })
const round = await new Par2Merger().round()
assert.deepEqual(round.folded, { looked: 5, sidecars: 2, folded: 1 })