tweak: read attribute from season folder name

This commit is contained in:
cxfksword 2024-05-18 16:12:52 +08:00
parent 104d200e7b
commit 747e69f3bf
1 changed files with 10 additions and 1 deletions

View File

@ -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)