Skip to content

Commit

Permalink
Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pithaya committed Jun 23, 2024
1 parent a35095d commit bb8c948
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,33 +233,29 @@ protected IEnumerable<string> ProcessImages(ImageList? imageList)
{
if (imageList == null)
{
return Enumerable.Empty<string>();
yield break;
}

var images = new List<string>();

if (!string.IsNullOrWhiteSpace(imageList.SuperUrl))
{
images.Add(imageList.SuperUrl);
yield return imageList.SuperUrl;
}
else if (!string.IsNullOrWhiteSpace(imageList.OriginalUrl))
{
images.Add(imageList.OriginalUrl);
yield return imageList.OriginalUrl;
}
else if (!string.IsNullOrWhiteSpace(imageList.MediumUrl))
{
images.Add(imageList.MediumUrl);
yield return imageList.MediumUrl;
}
else if (!string.IsNullOrWhiteSpace(imageList.SmallUrl))
{
images.Add(imageList.SmallUrl);
yield return imageList.SmallUrl;
}
else if (!string.IsNullOrWhiteSpace(imageList.ThumbUrl))
{
images.Add(imageList.ThumbUrl);
yield return imageList.ThumbUrl;
}

return images;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Net.Http.Json;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Extensions;
using Jellyfin.Plugin.Bookshelf.Common;
using Jellyfin.Plugin.Bookshelf.Providers.ComicVine.Models;
using MediaBrowser.Common.Net;
Expand Down Expand Up @@ -96,11 +97,10 @@ public async Task<MetadataResult<Person>> GetMetadata(PersonLookupInfo info, Can

if (!string.IsNullOrWhiteSpace(personDetails.Aliases))
{
var splittedAliases = personDetails.Aliases.Split('\n');
if (splittedAliases.Any())
{
person.OriginalTitle = splittedAliases.First();
}
person.OriginalTitle = personDetails.Aliases
.AsSpan()
.LeftPart('\n')
.ToString();
}

metadataResult.Item = person;
Expand Down

0 comments on commit bb8c948

Please sign in to comment.