feat(library): download history lists adopted tasks and organize records

- Migration 0053: download_task.media_entity_id (FK, set null on delete),
  backfilled from plan slot / source release / latest organize record.
- Submitted and adopted tasks carry the entity; entity merge follows it.
- GET /library/{id}: downloads also matched by dt.media_entity_id (adopted
  takeover tasks), plus organizationRecords (incl. manual path organizes);
  library list / inventory counts use it too.
- Web detail: "接管" marker and a list of records without a download task.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 20:54:10 +08:00
1 parent 74f1566985
commit 05d1f76b9f
9 files changed
+159 -11

No files matched your search

+1
View File
@@ -701,6 +701,7 @@ export interface DownloadTaskTable {
last_error: Json | null;
created_at: GeneratedTimestamptz;
updated_at: GeneratedTimestamptz;
media_entity_id: string | null;
}
export interface DownloaderInstanceTable {