✨ 新增功能
- 媒体库生效范围过滤:支持关闭“全部媒体库”并按勾选指定生效库(
EnableAllLibraries/EnabledLibraryIds),通过 SQLiteAncestorIds下推过滤与 15 秒计数短缓存,同时覆盖入库事件与所有计划任务 - 自定义集中备份目录:新增
CustomBackupDirectory配置,支持将-mediainfo.json与.metadata音频封面按_paths_v2编码镜像集中存放(适合媒体盘只读挂载);读取/恢复自动兼容回退同目录历史备份,「导出 STRM 媒体信息」支持将有效旧备份无损迁移至集中目录 - 精细化防风控与功能开关:新增随机延迟抖动(
ProcessingDelayJitterMs,0–30000 ms)、处理延迟上限提至 60000 ms,并新增附加视频(IncludeExtraVideos)、视频章节提取(ExtractVideoChapters)、音乐标签补全(EnableMusicMetadata)、外挂歌词关联(EnableExternalLyrics)与插件独立调试日志(EnableDebugLogging)开关 - 实时状态接口与全新配置页:新增
GET /StrmTool/Status运行状态接口;重做插件配置页,提供中英文切换、实时状态面板、计划任务快捷启停、风控预设、媒体库多选及集中目录校验提示,并更新插件 Logo
🛠 优化
- 并发模型与双通道调度:全局信号量仅约束真实远程探测;入库事件拆分为本地快车道与远程探测慢车道,按路径去重与 singleflight 协调并发,提取任务优先处理具备本地 JSON 的条目,防止本地恢复被慢速探测阻塞
- 并发配置热更新:修改“最大并发数”后新请求立即使用新容量,无需重启 Emby
- 写入原子化与备份一致性:
-mediainfo.json先写同目录临时文件再原子替换并按键路径加锁串行化;导出仅含当前版本自身媒体源;JSON 缓存与文档结构有效性缓存大幅降低大批量重复扫描开销 - 任务统计与配置页交互:提取任务区分统计成功/跳过/失败数并在取消时输出摘要;配置页补齐默认值回显、表单校验与防重复提交
🐛 修复
- 附加视频纳入批量任务:将
Trailer与MusicVideo纳入全库扫描范围,支持批量补写丢失备份与批量恢复 - 外挂字幕路径越界防护:从 JSON 备份恢复外挂字幕/歌词时仅取文件名、校验扩展名白名单并限制路径必须位于媒体目录内
- 补齐备份缺口与非破坏恢复:数据库已完整但缺少 JSON 时自动补写;旧版备份缺字段或空章节列表时保留库内原值;音频封面导出增加
.metadata/{basename}.*兜底、按真实扩展名落盘并自动绑定 Primary 图片 - 坏备份收敛与音乐标签边界:损坏 JSON 隔离保留最多两代(
.bak/.bak.1),隔离前校验(长度, mtime);IsLocked音频不再误标已探测;发行年份限制 1800–9999;流派只补缺失值;.strm读取限制 64 KB 上限并剥离 BOM
✨ Features
- Library Scope Filtering: Added
EnableAllLibrariesandEnabledLibraryIdsto restrict processing to selected libraries using SQLiteAncestorIdspushdown and a 15-second count cache, applying consistently to both new-item events and scheduled tasks - Custom Centralized Backup Directory: Added
CustomBackupDirectoryto store-mediainfo.jsonand.metadataaudio covers in an encoded_paths_v2mirror tree (ideal for read-only media mounts), with automatic fallback to legacy sidecar backups and lossless migration during export - Fine-Grained Rate-Limit & Feature Toggles: Added
ProcessingDelayJitterMs(0–30000 ms), raisedProcessingDelayMsmax to 60000 ms, and added independent toggles forIncludeExtraVideos,ExtractVideoChapters,EnableMusicMetadata,EnableExternalLyrics, andEnableDebugLogging - Live Status API & Redesigned Config UI: Added
GET /StrmTool/Statusendpoint and rebuiltconfigPagewith EN/ZH switching, live runtime metrics, scheduled task quick controls, rate-limit presets, library multi-select, and backup directory health checks, plus updated plugin logo
🛠 Improvements
- Dual-Lane Event Scheduling & Concurrency Model: Global concurrency semaphore now bounds only real remote probes; new-item events split into local fast lane and remote probe slow lane with path deduplication and singleflight coordination, while scheduled extraction prioritizes items with existing local JSON
- Hot-Reload Concurrency: Updating
MaxConcurrencytakes effect immediately for new requests without restarting Emby - Atomic Backup Writes & Caching:
-mediainfo.jsonuses atomic temp-file replacement with per-path coordination locks, exports only the item's own media source, and uses bounded audio-tag and document-validity caches to avoid repeated deserialization - Task Reporting & Form UX: Extract task now tracks succeeded/skipped/failed counts separately; config page fills default values, triggers native form validation, and prevents duplicate submissions
🐛 Fixes
- Include Extra Videos in Batch Tasks: Added
TrailerandMusicVideotoGetAllStrmFilesso scheduled export and restore tasks cover extras properly - External Subtitle Path Traversal Guard: Validates filenames, extension allowlist, and parent directory boundaries when restoring sidecar subtitles/lyrics from JSON backups
- Backfill Missing Backups & Non-Destructive Restore: Automatically backfills missing JSON when DB info is already complete; preserves existing DB values/chapters when omitted in legacy backups; improves audio cover fallback and Primary image binding
- Bounded Quarantine & Metadata Safeguards: Limits corrupt backup quarantine to
.bak/.bak.1after checking(length, mtime); stops markingIsLockedaudio as probed; clamps music release years to 1800–9999; avoids overwriting existing genres; caps.strmreads at 64 KB and strips leading BOM
Full Changelog: v2.7.0-emby...v2.8.0-emby