Repository navigation
Highlights
This patch release fixes split processed records after quarantine recovery (e.g., an album showing both a FAILED monitored-folder entry and a separate SUCCESS archived-library entry in Processed Records after Online Search or AI-assisted archiving), automatically reconciles pre-1.6.1 split history on startup, and hardens re-identification replacement and crash recovery. (fb78287)
Fixes
1. Unified recovery record lineage across all 6 recovery archiving paths (fb78287)
- Persistent source lineage (
RecoveryOriginRegistry): Tracks origin mappings fromfailed/,partial/, retry-exhausted quarantines, and single-file recovery workspaces (single-<jobId>) back to monitored source files indata/recovery-origins.json, preserving lineage across Recovery Recycle Bin move and restore operations. Includes conservative fallback inference for pre-1.6.1quarantined copies without forcing ambiguous matches. - Single primary record across all recovery exits: Converged all 6 recovery archiving paths onto the monitored-source record key:
- Online Search confirmation (
ONLINE_SEARCH) - AI-assisted Local Tags archiving (
LOCAL_TAGS) - Quarantine full re-identification direct commit
- Missing Covers completion & explicit "confirm no cover" archiving
- Pending Review MusicBrainz confirmation & unlisted-album archiving (also fixed missing quarantine copy recycling and
single-*workspace cleanup on this path) - Partial recognition LLM artist matching (also fixed missing processed-record persistence on this path)
- Online Search confirmation (
- Smart source-state handling: Performs an in-place
UPSERTupgrading the monitored source'sFAILEDrow toSUCCESS(withtarget_file_path) when the monitored file exists; atomically cleans up the staleFAILEDrow and records the archived path when the source file is confirmed deleted; preserves the monitored path key when the monitored directory is temporarily unavailable (e.g., NAS offline) to prevent unintended re-scans on remount.
2. Automatic idempotent startup reconciliation for historical split records (fb78287)
- Added
RecoveryRecordReconciler, which runs automatically once during startup beforeFileMonitorServicebegins scanning. - Reconciles pre-
1.6.1splitFAILED+ archivedSUCCESSalbum pairs using two strict evidence tiers:- Confirmed recovery history in
review-queue.json/review-queue-archive.jsonl - Album-wide bijective (1:1 unique) exact FLAC
STREAMINFOMD5 matching
- Confirmed recovery history in
- Atomically merges matched albums into single monitored-source
SUCCESSrecords while preserving the original archivedprocessed_time. Never modifies or deletes any audio files on disk.
3. Safe re-identification of recovered albums & UI warnings (fb78287)
- Re-identifying an already-recovered album automatically replaces and cleans up old archived files and empty parent directories when the output path changes.
- If re-identification fails, existing library files remain untouched, the failed record retains its original
target_file_path, and the replacement mapping continues propagating to the new quarantine copy. - Added
nonMbConfirmedCounttoProcessedRecordService.previewand surfaced a prominent warning in the Processed Records re-identify confirmation dialog (EN & ZH) whenever records archived via Online Search or AI Local Tags are selected.
4. Reliability, concurrency & crash-recovery hardening (fb78287)
- Persisted per-track commit manifests (
committedTrackRecords) to support crash-safe idempotent replay on restart. - Unified single-transaction / single-lock atomic record migration across SQLite, MySQL, and File storage modes.
- Added same-origin / audio-fingerprint verification before deleting same-named peer quarantine copies to prevent accidental removal of unrelated files.
- Preserved original monitored-source
file_hashandfile_sizeduring offline record updates.
Upgrade notes
- Zero manual migration required: No database schema (DDL) changes or config edits are needed. Upgrading directly from
1.6.0(or earlier) automatically reconciles eligible historical split records on first startup and persists future lineage indata/recovery-origins.json.
中文修复说明
本版本为维护修复版本,重点解决**隔离文件通过联网搜索 / AI 辅助本地标签等路径恢复入库后,「处理记录」中分裂出两条记录(旧失败记录 + 新归档记录)**的问题,并在启动时自动修复升级前已产生的历史分裂记录,同时加固了重新识别的旧归档替换与崩溃恢复能力。(fb78287)
修复内容
-
统一全部 6 个隔离恢复入库出口为单条主记录
- 新增
RecoveryOriginRegistry(持久化至data/recovery-origins.json),记录failed/、partial/、重试上限转失败及单文件恢复工作区(single-<jobId>)到监控源文件的血缘映射,并在回收站移入/还原过程中完整透传;对升级前存量隔离副本提供保守兜底反推(有歧义不强绑)。 - 统一收口以下 6 个恢复出口为监控源单条主记录,不再分裂出失败行与归档行:
- 联网搜索确认(
ONLINE_SEARCH) - AI 辅助本地标签入库(
LOCAL_TAGS) - 隔离目录完整重新识别直接提交
- 缺少封面补图 / 确认无封面入库
- 待确认页 MusicBrainz 版本确认 / 按未收录归档(同步修复该路径遗漏的隔离副本回收与
single-*临时目录清理) - 部分识别 LLM 艺术家匹配(同步补齐原本缺失的处理记录写入)
- 联网搜索确认(
- 监控源文件存在时原位
UPSERT将旧FAILED行升级为SUCCESS;确认已删除时原子清理旧FAILED行并记归档路径;监控目录暂不可访问(如 NAS 离线)时保留监控路径键,防止重新挂载后误触发重扫。
- 新增
-
启动期历史分裂记录自动幂等对账
- 新增
RecoveryRecordReconciler,在服务启动、文件监控开始扫描前自动执行一次。 - 基于两级严格证据(已确认恢复队列历史
review-queue.json/review-queue-archive.jsonl,或整夹双向唯一 FLACSTREAMINFOMD5 精确一一匹配),将升级前已分裂的历史专辑记录按整张专辑原子合并为监控源单条SUCCESS记录,完整保留原归档processed_time,绝不修改或删除任何磁盘音频文件。
- 新增
-
已恢复记录重新识别的旧归档替换与失败保底
- 对已恢复入库的记录触发「重新识别」时,若识别成功且输出路径变更,自动替换并清理旧归档文件与空目录;若重新识别失败,原输出音乐库文件保持不动,失败记录保留原
target_file_path且替换映射继续透传至新隔离副本。 - 「处理记录」页重新识别确认弹窗新增联网搜索 / AI 辅助入库来源的醒目提示,并更新旧归档自动替换说明文案(中英文同步)。
- 对已恢复入库的记录触发「重新识别」时,若识别成功且输出路径变更,自动替换并清理旧归档文件与空目录;若重新识别失败,原输出音乐库文件保持不动,失败记录保留原
-
并发与崩溃恢复加固
- 提交阶段持久化逐曲回写清单(
committedTrackRecords),支持进程崩溃重启后的幂等重放。 - 跨 SQLite / MySQL / 文件日志 三种存储模式均支持单事务 / 单次写锁原子迁移处理记录。
- 对侧同名隔离副本清理前强制同源 / 音频指纹核验防误删;离线更新不覆写原监控源
file_hash/file_size。
- 提交阶段持久化逐曲回写清单(
升级说明
- 零侵入平滑升级:无任何数据库表结构(DDL)变更,也无需修改配置文件。直接更新镜像或 JAR 启动后即可自动对账历史分裂记录。
Full changelog: v1.6.0...v1.6.1