Judge: the tiny rule, the catalog's side of the edge's tiny-archive rule
One file of one article, 2–100 kB, under a readable release-like name outside the music, e-book and comic groups, without an e-book, subtitle, crack or sidecar word: the 2015–17 flood's 1.5M rows that the edge indexed before its rule. The same tests as isTinyArchive in Postgres's regex dialect; no join on the candidates (98% of a sample have an archive candidate, the rest lone par2 files and scrambled names). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
411c36eec0
commit
a71de56a7c
3 files changed
+79
-2
No files matched your search
@@ -163,6 +163,55 @@ test.group('ReleaseJudge', (group) => {
|
||||
assert.isNull(await db.from('release_verdicts').where('release_id', locked).first())
|
||||
})
|
||||
|
||||
test('judges tiny single-article files under release-like names', async ({ assert }) => {
|
||||
let n = 0
|
||||
const settled = new Date(Date.now() - 3 * 86400_000)
|
||||
const release = async (name: string, extra: Record<string, unknown> = {}) => {
|
||||
n++
|
||||
const key = `jt${String(n).padStart(6, '0')}`.padEnd(40, '0')
|
||||
return Number(
|
||||
await insertRelease({
|
||||
release_key: key,
|
||||
identity_key: key,
|
||||
name,
|
||||
source: 'stem',
|
||||
groups: ['alt.binaries.boneless'],
|
||||
files: 1,
|
||||
segments: 1,
|
||||
bytes: 15_000,
|
||||
posted_at: settled,
|
||||
readable: true,
|
||||
settled_at: settled,
|
||||
...extra,
|
||||
})
|
||||
)
|
||||
}
|
||||
const dotted = await release('Velvet.S02E20.GERMAN.720p.HDTV.x264-ACED')
|
||||
const spaced = await release('Pacific Rim (2013) BDRip DVDr-sailo1')
|
||||
const subs = await release('Some.Film.2019.German.Subs-XYZ')
|
||||
const ebook = await release('Some.Book.2019.epub-GRP')
|
||||
const music = await release('Some.Album.2019.FLAC-GRP', { groups: ['alt.binaries.sounds.flac'] })
|
||||
const big = await release('Big.Film.2019.1080p-GRP', { bytes: 500_000 })
|
||||
const twoFiles = await release('Two.Films.2019.1080p-GRP', { files: 2, segments: 2 })
|
||||
const plain = await release('Holiday photo')
|
||||
const sidecar = await release('Side.Car.2019.1080p-GRP', { sidecar_only: true })
|
||||
const unreadable = await release('Xk9v.2019.Qpz-ab', { readable: false })
|
||||
|
||||
const round = await new ReleaseJudge().full()
|
||||
const verdicts = new Map(
|
||||
(await db.from('release_verdicts').select('release_id', 'rule')).map((v) => [
|
||||
Number(v.release_id),
|
||||
v.rule,
|
||||
])
|
||||
)
|
||||
assert.equal(verdicts.get(dotted), 'tiny')
|
||||
assert.equal(verdicts.get(spaced), 'tiny')
|
||||
for (const id of [subs, ebook, music, big, twoFiles, plain, sidecar, unreadable]) {
|
||||
assert.notEqual(verdicts.get(id), 'tiny')
|
||||
}
|
||||
assert.equal(round.rules.tiny.added, 2)
|
||||
})
|
||||
|
||||
test('judges the releases whose facts changed, and those a hash of theirs tipped over', async ({
|
||||
assert,
|
||||
}) => {
|
||||
|
||||
Reference in new issue
Block a user