github jinlin-teck/StrmTool v2.3.1-jellyfin

latest releases: v2.5.1-emby, v2.5.0-emby, v2.4.0-jellyfin...
3 months ago

更新日志

🚀 核心优化

  • 减少重复写入:探测阶段只保存 MediaStreams,不保存 Item 元数据,避免与 Jellyfin 元数据重置产生竞态条件
  • 简化恢复逻辑:ItemUpdateListener 只恢复 Size、Container、RunTimeTicks(Jellyfin 不会重置 MediaStreams)
  • 简化缓存结构:只保留必要字段(Size、Container、RunTimeTicks),移除 TotalBitrate、Width、Height(已在 MediaStreams 中)

🔧 代码改进

  • 🏗️ 职责分离:探测只负责获取和缓存,恢复只负责从缓存恢复
  • 🏗️ 移除冗余代码:删除不再使用的 SaveItemWithRetryAsync 方法
  • 🏗️ 依赖简化:ItemUpdateListener 移除 IMediaStreamRepository 依赖

🚨 关键修复

  • 🛡️ 并发安全:移除 SemaphoreSlim 运行时热替换逻辑,避免并发控制失效(MaxConcurrentExtract 需重启生效)
  • 🔧 Dispose 死锁修复:改用 Task.WhenAny 实现异步超时等待,避免同步阻塞导致的潜在死锁
  • 🔧 任务管理优化ConcurrentBag<Task> 改为 ConcurrentDictionary<Guid, Task>,复用 ID 作为防重键

💡 其他改进

  • 🔧 配置线程安全_config 字段声明为 volatile,确保多线程读取安全
  • 🔧 进度报告:添加 Math.Min 防止进度超过 100%
  • 🔧 日志格式统一LocalizationManager 日志格式统一为结构化日志
  • 🏗️ 代码复用优化:提取通用验证方法和处理核心方法

Update Log

🚀 Core Optimizations

  • Reduced Redundant Writes: During the probing phase, only MediaStreams are saved; Item metadata is not saved to avoid race conditions with Jellyfin's metadata reset.
  • Simplified Recovery Logic: The ItemUpdateListener now only restores Size, Container, and RunTimeTicks (Jellyfin does not reset MediaStreams).
  • Simplified Cache Structure: Only necessary fields (Size, Container, RunTimeTicks) are retained. TotalBitrate, Width, and Height have been removed (as they are already in MediaStreams).

🔧 Code Improvements

  • 🏗️ Separation of Responsibilities: Probing is only responsible for fetching and caching; recovery is only responsible for restoring from cache.
  • 🏗️ Removed Redundant Code: Deleted the no longer used SaveItemWithRetryAsync method.
  • 🏗️ Dependency Simplification: ItemUpdateListener no longer depends on IMediaStreamRepository.

🚨 Critical Fixes

  • 🛡️ Concurrency Safety: Removed SemaphoreSlim runtime hot-replacement logic to prevent concurrency control failures (MaxConcurrentExtract requires a restart to take effect).
  • 🔧 Dispose Deadlock Fix: Replaced with Task.WhenAny for asynchronous timeout waiting, avoiding potential deadlocks caused by synchronous blocking.
  • 🔧 Task Management Optimization: Changed ConcurrentBag<Task> to ConcurrentDictionary<Guid, Task>, reusing ID as a duplicate prevention key.

💡 Other Improvements

  • 🔧 Configuration Thread Safety: The _config field is declared as volatile to ensure safe multi-threaded reads.
  • 🔧 Progress Reporting: Added Math.Min to prevent progress from exceeding 100%.
  • 🔧 Log Format Standardization: LocalizationManager log format unified to structured logging.
  • 🏗️ Code Reuse Optimization: Extracted common validation methods and core processing methods.

Don't miss a new StrmTool release

NewReleases is sending notifications on new releases.