mirror of
https://github.com/metatube-community/jellyfin-plugin-metatube.git
synced 2026-07-17 03:50:42 +08:00
private GetActorImageUrl
This commit is contained in:
@@ -99,20 +99,6 @@ public static class ApiClient
|
||||
return ComposeImageApiUrl(BackdropImageApi, id, provider, url, position, auto);
|
||||
}
|
||||
|
||||
public static async Task<string> GetActorImageUrl(string name, CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Use GFriends as actor image provider.
|
||||
return (await GetActorInfo(name, Constant.GFriends, cancellationToken)).Images[0];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore all exceptions and return empty url.
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<ActorInfoModel> GetActorInfo(string id, string provider,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -89,7 +89,7 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider<Movie, MovieI
|
||||
{
|
||||
Name = name,
|
||||
Type = PersonType.Actor,
|
||||
ImageUrl = await ApiClient.GetActorImageUrl(name, cancellationToken)
|
||||
ImageUrl = await GetActorImageUrl(name, cancellationToken)
|
||||
});
|
||||
|
||||
return result;
|
||||
@@ -129,4 +129,18 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider<Movie, MovieI
|
||||
{
|
||||
return $"{m.Number} {m.Title}";
|
||||
}
|
||||
|
||||
private static async Task<string> GetActorImageUrl(string name, CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Use GFriends as actor image provider.
|
||||
return (await ApiClient.GetActorInfo(name, Constant.GFriends, cancellationToken)).Images[0];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore all exceptions and return empty url.
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user