github jinlin-teck/StrmTool v2.8.0-emby

one hour ago

✨ 新增功能

  • 媒体库生效范围过滤:支持关闭“全部媒体库”并按勾选指定生效库(EnableAllLibraries / EnabledLibraryIds),通过 SQLite AncestorIds 下推过滤与 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 EnableAllLibraries and EnabledLibraryIds to restrict processing to selected libraries using SQLite AncestorIds pushdown and a 15-second count cache, applying consistently to both new-item events and scheduled tasks
  • Custom Centralized Backup Directory: Added CustomBackupDirectory to store -mediainfo.json and .metadata audio covers in an encoded _paths_v2 mirror 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), raised ProcessingDelayMs max to 60000 ms, and added independent toggles for IncludeExtraVideos, ExtractVideoChapters, EnableMusicMetadata, EnableExternalLyrics, and EnableDebugLogging
  • Live Status API & Redesigned Config UI: Added GET /StrmTool/Status endpoint and rebuilt configPage with 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 MaxConcurrency takes effect immediately for new requests without restarting Emby
  • Atomic Backup Writes & Caching: -mediainfo.json uses 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 Trailer and MusicVideo to GetAllStrmFiles so 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.1 after checking (length, mtime); stops marking IsLocked audio as probed; clamps music release years to 1800–9999; avoids overwriting existing genres; caps .strm reads at 64 KB and strips leading BOM

Full Changelog: v2.7.0-emby...v2.8.0-emby

Don't miss a new StrmTool release

NewReleases is sending notifications on new releases.