releases rebuilt without its text copies: poster_id, group_set_id, bytea keys, source smallint, edge, settled_at as the finish. posters by id, group_sets. blocks as the lease unit, ranges.block_id. fragments, range_blocks, release_final, the settler and the fragment merger gone; release_chunks, rule_counts and rule_samples keyed by block. Cold tables on CHUNK_TABLESPACE. Migration 6000 truncates the catalog and refuses without VOYAGER3_RESET=1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
20 lines
783 B
TypeScript
20 lines
783 B
TypeScript
import { test } from '@japa/runner'
|
|
import { SOURCES, sourceCode, sourceName } from '#lib/release/source'
|
|
|
|
test.group('release source codes', () => {
|
|
test('names and codes map both ways; the codes are fixed', ({ assert }) => {
|
|
assert.deepEqual(SOURCES, { subject: 1, post: 2, stem: 3, spot: 4, nzb: 5, album: 6 })
|
|
for (const [name, code] of Object.entries(SOURCES)) {
|
|
assert.equal(sourceCode(name), code)
|
|
assert.equal(sourceName(code), name)
|
|
assert.equal(sourceName(String(code)), name)
|
|
}
|
|
})
|
|
|
|
test('an unknown name throws, an unknown code reads as unknown', ({ assert }) => {
|
|
assert.throws(() => sourceCode('subjekt'), /Unknown release source/)
|
|
assert.equal(sourceName(99), 'unknown')
|
|
assert.equal(sourceName(null), 'unknown')
|
|
})
|
|
})
|