Spotnet import, header backfill, staging and counter grouping, faster search

Spotnet (CONCEPT D29):
- Index free.pt fully and import spots with their descriptions, categories
  and NZBs; a spot renames its release, since Spotnet names are more
  trustworthy than names derived from subjects.
- Find passwords in spot descriptions too, and tell "needs a password we
  have" from "needs a password we don't have".

Content inspection:
- List the contents of 7z (.7z.001) archives, SFV sets, nicovideo uploads
  and other archive-like files; mark yEncBin .bin containers as encrypted.
- Take real names from yEnc headers for randomly named files, and merge
  uploads that were split across posts.

Storage (D31, D32):
- Store segment lists zstd-compressed behind the FileStore accessor.
- group:backfill indexes older headers at low priority and pauses when
  the NVMe or HDD part of the database gets too large.

Grouping (D35, D36):
- Lone header segments wait in staged_segments until a second segment of
  their file arrives, which drops the per-article junk binaries.
- Counter grouping joins random-subject uploads by poster, [i/M] counter,
  part count and day.

Search and maintenance (D33, D34):
- A trigram-indexed search_text column, smaller indexes, estimated stats.
- Passes that clean up nonsense names; weekly index maintenance; GC budgets
  per kind.
- Web UI: grey out stale results while a search runs and cancel superseded
  requests. Count only up to 1,000 matches for the page, which made filter
  clicks take seconds (Newznab keeps the 10,000 cap).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-03 19:59:23 +02:00
1 parent bcb9be5da9
commit be8a3d4580
97 files changed
+4454 -268

No files matched your search

+57 -7
View File
@@ -148,8 +148,10 @@ export class DeferredRangeSchema extends BaseModel {
}
export class FetchRangeSchema extends BaseModel {
static $columns = ['createdAt', 'endId', 'error', 'groupId', 'id', 'requeues', 'startId', 'status', 'updatedAt'] as const
static $columns = ['backfill', 'createdAt', 'endId', 'error', 'groupId', 'id', 'requeues', 'startId', 'status', 'updatedAt'] as const
$columns = FetchRangeSchema.$columns
@column()
declare backfill: boolean
@column.dateTime({ autoCreate: true })
declare createdAt: DateTime
@column()
@@ -171,7 +173,7 @@ export class FetchRangeSchema extends BaseModel {
}
export class FileSchema extends BaseModel {
static $columns = ['archive', 'contentType', 'createdAt', 'date', 'fileKey', 'filename', 'groups', 'id', 'messageIds', 'parts', 'poster', 'realName', 'releaseId', 'size', 'updatedAt'] as const
static $columns = ['archive', 'contentType', 'createdAt', 'date', 'fileKey', 'filename', 'firstMessageId', 'groups', 'id', 'parts', 'poster', 'realName', 'releaseId', 'segments', 'size', 'updatedAt'] as const
$columns = FileSchema.$columns
@column()
declare archive: any | null
@@ -186,12 +188,12 @@ export class FileSchema extends BaseModel {
@column()
declare filename: string
@column()
declare firstMessageId: string | null
@column()
declare groups: any | null
@column({ isPrimary: true })
declare id: number
@column()
declare messageIds: any
@column()
declare parts: number
@column()
declare poster: string
@@ -200,16 +202,22 @@ export class FileSchema extends BaseModel {
@column()
declare releaseId: bigint | number | null
@column()
declare segments: Buffer
@column()
declare size: bigint | number | null
@column.dateTime({ autoCreate: true, autoUpdate: true })
declare updatedAt: DateTime | null
}
export class GroupSchema extends BaseModel {
static $columns = ['active', 'createdAt', 'fetchBodies', 'id', 'lastIndexedId', 'lastQueuedId', 'name', 'updatedAt'] as const
static $columns = ['active', 'backfillNextId', 'backfillUntilId', 'createdAt', 'fetchBodies', 'id', 'lastIndexedId', 'lastQueuedId', 'name', 'updatedAt'] as const
$columns = GroupSchema.$columns
@column()
declare active: boolean
@column()
declare backfillNextId: bigint | number | null
@column()
declare backfillUntilId: bigint | number | null
@column.dateTime({ autoCreate: true })
declare createdAt: DateTime | null
@column()
@@ -292,7 +300,7 @@ export class ReleaseFileSchema extends BaseModel {
}
export class ReleaseSchema extends BaseModel {
static $columns = ['category', 'complete', 'container', 'contents', 'encrypted', 'fileCount', 'fileTotal', 'firstSeenAt', 'groups', 'id', 'lastSeenAt', 'name', 'password', 'postedAt', 'poster', 'releaseKey', 'size', 'source'] as const
static $columns = ['category', 'complete', 'container', 'contents', 'encrypted', 'fileCount', 'fileTotal', 'firstSeenAt', 'groups', 'id', 'lastSeenAt', 'name', 'password', 'passwordSource', 'postedAt', 'poster', 'releaseKey', 'searchFiles', 'searchText', 'size', 'source'] as const
$columns = ReleaseSchema.$columns
@column()
declare category: number | null
@@ -320,6 +328,8 @@ export class ReleaseSchema extends BaseModel {
declare name: string
@column({ serializeAs: null })
declare password: string | null
@column()
declare passwordSource: string | null
@column.dateTime()
declare postedAt: DateTime | null
@column()
@@ -327,13 +337,32 @@ export class ReleaseSchema extends BaseModel {
@column()
declare releaseKey: string
@column()
declare searchFiles: string | null
@column()
declare searchText: string | null
@column()
declare size: bigint | number
@column()
declare source: string | null
}
export class SfvEntrySchema extends BaseModel {
static $columns = ['crc', 'name', 'postedAt', 'poster', 'releaseId'] as const
$columns = SfvEntrySchema.$columns
@column()
declare crc: string
@column()
declare name: string
@column.dateTime()
declare postedAt: DateTime | null
@column()
declare poster: string | null
@column({ isPrimary: true })
declare releaseId: bigint | number
}
export class SpotSchema extends BaseModel {
static $columns = ['articleNumber', 'category', 'createdAt', 'error', 'groupName', 'keyId', 'messageId', 'postedAt', 'poster', 'processedAt', 'releaseId', 'size', 'spotterId', 'status', 'subcats', 'tag', 'title', 'website'] as const
static $columns = ['articleNumber', 'category', 'createdAt', 'description', 'detailsAt', 'error', 'groupName', 'image', 'keyId', 'messageId', 'postedAt', 'poster', 'processedAt', 'releaseId', 'size', 'spotterId', 'status', 'subcats', 'tag', 'title', 'verified', 'website'] as const
$columns = SpotSchema.$columns
@column()
declare articleNumber: bigint | number | null
@@ -342,10 +371,16 @@ export class SpotSchema extends BaseModel {
@column.dateTime({ autoCreate: true })
declare createdAt: DateTime
@column()
declare description: string | null
@column.dateTime()
declare detailsAt: DateTime | null
@column()
declare error: string | null
@column()
declare groupName: string
@column()
declare image: any | null
@column()
declare keyId: number | null
@column({ isPrimary: true })
declare messageId: string
@@ -370,9 +405,24 @@ export class SpotSchema extends BaseModel {
@column()
declare title: string
@column()
declare verified: boolean | null
@column()
declare website: string | null
}
export class StagedSegmentSchema extends BaseModel {
static $columns = ['counterKey', 'fileKey', 'segments', 'stagedAt'] as const
$columns = StagedSegmentSchema.$columns
@column()
declare counterKey: string | null
@column({ isPrimary: true })
declare fileKey: string
@column()
declare segments: any
@column.dateTime()
declare stagedAt: DateTime
}
export class UserSchema extends BaseModel {
static $columns = ['createdAt', 'email', 'fullName', 'id', 'password', 'updatedAt'] as const
$columns = UserSchema.$columns