implemented a lot of features

This commit is contained in:
Daan Meijer committed 2026-09-29 00:32:01 +02:00
1 parent 62f1767df3
commit bcb9be5da9
141 files changed
+10705 -385

No files matched your search

@@ -0,0 +1,30 @@
import { BaseSchema } from '@adonisjs/lucid/schema'
/**
* yEnc CRCs of body-derived articles, so split volumes can be verified
* without downloading them (CONCEPT.md D20): the combined part CRCs of a
* volume must equal the whole-file crc32 in its last part.
*/
export default class extends BaseSchema {
async up() {
for (const tableName of ['parts', 'part_conflicts']) {
this.schema.alterTable(tableName, (table) => {
table.string('pcrc32', 8)
// Decoded length of the part (=ypart end - begin + 1).
table.integer('part_size')
// Whole-file CRC32, when the poster included it (usually in the last part).
table.string('file_crc32', 8)
})
}
}
async down() {
for (const tableName of ['parts', 'part_conflicts']) {
this.schema.alterTable(tableName, (table) => {
table.dropColumn('pcrc32')
table.dropColumn('part_size')
table.dropColumn('file_crc32')
})
}
}
}