From 747e69f3bfb3eb6692cb18438039c32acddfc0be Mon Sep 17 00:00:00 2001 From: cxfksword <718792+cxfksword@users.noreply.github.com> Date: Sat, 18 May 2024 16:12:52 +0800 Subject: [PATCH] tweak: read attribute from season folder name --- Jellyfin.Plugin.MetaShark/Providers/SeasonProvider.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Plugin.MetaShark/Providers/SeasonProvider.cs b/Jellyfin.Plugin.MetaShark/Providers/SeasonProvider.cs index d3f8d9d..1d5aa17 100644 --- a/Jellyfin.Plugin.MetaShark/Providers/SeasonProvider.cs +++ b/Jellyfin.Plugin.MetaShark/Providers/SeasonProvider.cs @@ -140,12 +140,21 @@ namespace Jellyfin.Plugin.MetaShark.Providers return null; } - // 没有季文件夹(即虚拟季),info.Path会为空,直接用series的sid + // 没有季文件夹或季文件夹名不规范(即虚拟季),info.Path会为空,直接用series的sid if (string.IsNullOrEmpty(info.Path)) { return sid; } + // 从文件夹名属性格式获取,如[douban-12345]或[doubanid-12345] + var fileName = this.GetOriginalFileName(info); + var doubanId = this.regDoubanIdAttribute.FirstMatchGroup(fileName); + if (!string.IsNullOrWhiteSpace(doubanId)) + { + this.Log($"Found season douban [id] by attr: {doubanId}"); + return doubanId; + } + // 从sereis获取正确名称,info.Name当是标准格式如S01等时,会变成第x季,非标准名称默认文件名 var series = await this._doubanApi.GetMovieAsync(sid, cancellationToken).ConfigureAwait(false); if (series == null)