mirror of
https://github.com/metatube-community/jellyfin-plugin-metatube.git
synced 2026-02-02 18:21:48 +08:00
Fix: actor image auto fallback (#339)
This commit is contained in:
@@ -248,12 +248,16 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider<Movie, MovieI
|
||||
try
|
||||
{
|
||||
var results = await ApiClient.SearchActorAsync(actor.Name, cancellationToken);
|
||||
// Use GFriends as actor image provider.
|
||||
// Use the first result as the primary actor selection.
|
||||
if (results.Any())
|
||||
{
|
||||
actor.ImageUrl = results.First().Images?.FirstOrDefault();
|
||||
actor.SetPid(Name, results.First().Provider, results.First().Id);
|
||||
}
|
||||
|
||||
// Use the GFriends to update the actor profile image.
|
||||
foreach (var result in results.Where(result => result.Provider == GFriends && result.Images?.Any() == true))
|
||||
actor.ImageUrl = result.Images.First();
|
||||
|
||||
// Use the first Result as PID.
|
||||
if (results.Any()) actor.SetPid(Name, results.First().Provider, results.First().Id);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user