Skip to content

feat: add library selection filter - #2

Draft
hikyuu wants to merge 4 commits into
Sandings:mainfrom
hikyuu:feature-filter
Draft

feat: add library selection filter#2
hikyuu wants to merge 4 commits into
Sandings:mainfrom
hikyuu:feature-filter

Conversation

@hikyuu

@hikyuu hikyuu commented Jun 1, 2026

Copy link
Copy Markdown

概述

新增媒体库选择过滤功能,让用户可以精确控制翻译范围。

变更内容

媒体库选择过滤 (Library Selection Filter)

  • 在插件配置中新增 \Libraries to Translate\ 多选配置项
  • 注入 \ILibraryManager\ 以获取 Emby 中已配置的媒体库列表
  • 自动填充媒体库选项供用户勾选
  • 在 \SubZEntryPoint\ 中新增 \IsLibrarySelected()\ 方法,通过媒体库物理路径匹配判断条目是否属于被选中的媒体库
  • 未选择任何媒体库时默认处理所有库,出错时 fail-open 避免阻塞入库流程

涉及的文件

文件 变更类型
\src/SubZ.Plugin/Configuration/PluginOptions.cs\ 修改
\src/SubZ.Plugin/Plugin.cs\ 修改
\src/SubZ.Plugin/SubZEntryPoint.cs\ 修改

测试说明

  • 媒体库过滤:在配置中勾选部分媒体库,验证只有对应库的影片会被翻译
  • 留空行为:配置留空时退化为默认行为(全部处理)

hikyuu added 3 commits June 4, 2026 00:21
- Introduce library-level filtering for ingest hook via `SelectedLibraryIds`
- Add `SkipEmbeddedLanguageCodes` option to skip translation based on embedded subtitle languages
- Populate library and language multi-select lists in plugin UI
- Extend entry point to only process items in selected libraries
- Check embedded subtitle languages against skip list before translating
Add support for Arabic, Korean, Thai, Vietnamese, Indonesian, Turkish,
and Malay in both language selector options and ffprobe lookup table.
…vider

Extract FfprobeLanguageLookup from SubtitleSourceResolver into
LanguageSelectOptionProvider to centralize language code mapping
and allow reuse by other components.
@hikyuu
hikyuu marked this pull request as draft June 3, 2026 16:46
This reverts the embedded language skip filter feature, keeping only
the library selection filter. The LanguageSelectOptionProvider and
related ShouldSkipEmbeddedByLanguage logic are removed.

Reason: The embedded language skip approach (matching embedded subtitle
track languages via ffprobe) was deemed not robust enough. The original
HasEmbeddedTargetSubtitle check is restored.

This partially reverts:
- feat(libraries): add library selection and embedded language skip filter
- feat(languages): add missing language entries
- refactor(languages): move ffprobe language lookup table to shared provider
@hikyuu hikyuu changed the title feat: add library selection filter and embedded language skip filter feat: add library selection filter Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant