mirror of
https://github.com/jellyfin/jellyfin-plugin-anidb.git
synced 2024-11-23 13:59:43 +00:00
compatibility update
This commit is contained in:
parent
1d6a79b5af
commit
db188bc986
@ -2,8 +2,8 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;</TargetFrameworks>
|
||||
<AssemblyVersion>1.2.8.0</AssemblyVersion>
|
||||
<FileVersion>1.2.8.0</FileVersion>
|
||||
<AssemblyVersion>1.2.9.0</AssemblyVersion>
|
||||
<FileVersion>1.2.9.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -15,7 +15,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="mediabrowser.server.core" Version="3.3.59-beta" />
|
||||
<PackageReference Include="mediabrowser.server.core" Version="3.6.0.5-beta" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -38,11 +38,11 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Metadata
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
private readonly IHttpClient _httpClient;
|
||||
|
||||
private readonly Dictionary<string, string> _typeMappings = new Dictionary<string, string>
|
||||
private readonly Dictionary<string, PersonType> _typeMappings = new Dictionary<string, PersonType>
|
||||
{
|
||||
{"Direction", PersonType.Director},
|
||||
{"Music", PersonType.Composer},
|
||||
{"Chief Animation Direction", "Chief Animation Director"}
|
||||
{"Chief Animation Direction", PersonType.Director}
|
||||
};
|
||||
|
||||
public AniDbSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient)
|
||||
@ -516,10 +516,14 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Metadata
|
||||
private PersonInfo CreatePerson(string name, string type, string role = null)
|
||||
{
|
||||
// todo find nationality of person and conditionally reverse name order
|
||||
PersonType mappedType;
|
||||
|
||||
if (!_typeMappings.TryGetValue(type, out string mappedType))
|
||||
if (!_typeMappings.TryGetValue(type, out mappedType))
|
||||
{
|
||||
mappedType = type;
|
||||
if (!Enum.TryParse(type, true, out mappedType))
|
||||
{
|
||||
mappedType = PersonType.Actor;
|
||||
}
|
||||
}
|
||||
|
||||
return new PersonInfo
|
||||
@ -530,6 +534,16 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Metadata
|
||||
};
|
||||
}
|
||||
|
||||
private PersonInfo CreatePerson(string name, PersonType type, string role = null)
|
||||
{
|
||||
return new PersonInfo
|
||||
{
|
||||
Name = ReverseNameOrder(name),
|
||||
Type = type,
|
||||
Role = role
|
||||
};
|
||||
}
|
||||
|
||||
public static string ReverseNameOrder(string name)
|
||||
{
|
||||
return name.Split(' ').Reverse().Aggregate(string.Empty, (n, part) => n + " " + part).Trim();
|
||||
|
@ -214,7 +214,6 @@ query ($query: String, $type: MediaType) {
|
||||
{
|
||||
PersonInfo pi = new PersonInfo();
|
||||
pi.Name = edge.node.name.first+" "+ edge.node.name.last;
|
||||
pi.ItemId = await ToGuid(edge.node.id, cancellationToken);
|
||||
pi.ImageUrl = edge.node.image.large;
|
||||
pi.Role = edge.role;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user