mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-03 04:26:36 +08:00
feat(organize/scan): transfer modes, seeding-safe relocation, inode dedup, incremental scanning
- Organizer: add move/copy/hardlink/symlink transfer modes (default move), per-request target_path/transfer_mode overrides, and honor organize.target_dir / organize.transfer_mode settings. - keep_seeding (default on): escalate move->hardlink (cross-device->copy) so the qBittorrent source stays in place and continues seeding after organize. - qBittorrent SetLocation + POST /downloads/relocate to migrate whole torrents while keeping them seeding. - Scanner: FileID (device:inode) hardlink dedup to avoid duplicate recognition and double-counted storage; extract single-file ingest. - Watcher: recursive watch + incremental per-file ingest/remove instead of full re-scan; periodic full library scan now gated behind scan.periodic_enabled (default off) to reduce disk wear. - Telegram bot: handle callback_query in polling, declare allowed_updates in webhook, answer callbacks. - Frontend: settings for transfer mode / keep_seeding / periodic scan; organize panel target dir + transfer mode overrides. - Tests for transfer modes, organizer resolution, SetLocation, inode dedup, incremental ingest/remove. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -96,6 +96,12 @@ type Media struct {
|
||||
// Computed on-demand by the duplicate finder; format: "<hex>-<size>".
|
||||
FileHash string `gorm:"index;size:64" json:"file_hash,omitempty"`
|
||||
|
||||
// FileID is a "device:inode" identity for the underlying file. Hardlinks
|
||||
// to the same data share a FileID, letting the scanner skip re-importing a
|
||||
// seeding source kept by keep_seeding and its organized hardlink as two
|
||||
// separate items (avoids duplicate rows + double-counted storage).
|
||||
FileID string `gorm:"index;size:64" json:"file_id,omitempty"`
|
||||
|
||||
// IsDuplicate flags this media as a duplicate of another media row.
|
||||
IsDuplicate bool `gorm:"default:false" json:"is_duplicate"`
|
||||
DuplicateOf string `gorm:"size:36" json:"duplicate_of,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user