Fix variety show actor list

This commit is contained in:
cxfksword 2023-01-18 18:25:58 +08:00
parent 996a6a14d1
commit b3792761c4
5 changed files with 10 additions and 9 deletions

View File

@ -31,7 +31,7 @@ namespace Jellyfin.Plugin.MetaShark.Test
[TestMethod]
public void TestGetMetadata()
{
var info = new SeriesInfo() { Name = "外科医生奉达熙", ProviderIds = new Dictionary<string, string>() { { BaseProvider.DoubanProviderId, "2241528" } } };
var info = new SeriesInfo() { Name = "奔跑吧兄弟" };
var doubanApi = new DoubanApi(loggerFactory);
var tmdbApi = new TmdbApi(loggerFactory);
var omdbApi = new OmdbApi(loggerFactory);

View File

@ -450,11 +450,6 @@ namespace Jellyfin.Plugin.MetaShark.Api
celebrityRole = celebrityRoleType;
}
if (celebrityRoleType != "导演" && celebrityRoleType != "配音" && celebrityRoleType != "演员")
{
continue;
}
var celebrity = new DoubanCelebrity();
celebrity.Id = celebrityId;
celebrity.Name = celebrityName;

View File

@ -132,10 +132,10 @@ namespace Jellyfin.Plugin.MetaShark.Model
{
if (string.IsNullOrEmpty(this._roleType))
{
return this.Role.Equals("导演", StringComparison.Ordinal) ? MediaBrowser.Model.Entities.PersonType.Director : MediaBrowser.Model.Entities.PersonType.Actor;
return this.Role.Contains("导演", StringComparison.Ordinal) ? MediaBrowser.Model.Entities.PersonType.Director : MediaBrowser.Model.Entities.PersonType.Actor;
}
return this._roleType.Equals("导演", StringComparison.Ordinal) ? MediaBrowser.Model.Entities.PersonType.Director : MediaBrowser.Model.Entities.PersonType.Actor;
return this._roleType.Contains("导演", StringComparison.Ordinal) ? MediaBrowser.Model.Entities.PersonType.Director : MediaBrowser.Model.Entities.PersonType.Actor;
}
set
{

View File

@ -51,6 +51,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
protected readonly IHttpContextAccessor _httpContextAccessor;
protected Regex regMetaSourcePrefix = new Regex(@"^\[.+\]", RegexOptions.Compiled);
protected Regex regSeasonNameSuffix = new Regex(@"\s第.季$", RegexOptions.Compiled);
protected PluginConfiguration config
{
@ -399,5 +400,10 @@ namespace Jellyfin.Plugin.MetaShark.Providers
return Path.GetFileNameWithoutExtension(info.Path) ?? info.Name;
}
protected string RemoveSeasonSubfix(string name)
{
return regSeasonNameSuffix.Replace(name, "");
}
}
}

View File

@ -110,7 +110,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
var item = new Series
{
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, subject.Sid }, { Plugin.ProviderId, MetaSource.Douban } },
Name = subject.Name,
Name = RemoveSeasonSubfix(subject.Name),
OriginalTitle = subject.OriginalName,
CommunityRating = subject.Rating,
Overview = subject.Intro,