Skip to content

Commit

Permalink
tweak: read attribute from season folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfksword committed May 18, 2024
1 parent 104d200 commit 747e69f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Jellyfin.Plugin.MetaShark/Providers/SeasonProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,21 @@ public async Task<MetadataResult<Season>> GetMetadata(SeasonInfo info, Cancellat
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)
Expand Down

0 comments on commit 747e69f

Please sign in to comment.