Adjust structure of the classes to v3.2 response (#56)

Co-authored-by: Aliaksei Markouski <markalex2209@gmail.com>
This commit is contained in:
markalex2209 2024-11-04 13:33:30 +02:00 committed by GitHub
parent fbacdb243f
commit e31206f069
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View File

@ -5,6 +5,10 @@ namespace Jellyfin.Plugin.Fanart.Dtos
{
public class Album
{
[JsonPropertyName("release_group_id")]
public string ReleaseGroupId { get; set; }
[JsonPropertyName("cdart")]
public List<ArtistImage> CdArts { get; set; }

View File

@ -33,6 +33,6 @@ namespace Jellyfin.Plugin.Fanart.Dtos
public List<ArtistImage> HdmusicArts { get; set; }
[JsonPropertyName("albums")]
public Dictionary<string, Album> Albums { get; set; }
public List<Album> Albums { get; set; }
}
}

View File

@ -136,9 +136,9 @@ namespace Jellyfin.Plugin.Fanart.Providers
if (obj.Albums != null)
{
var album = obj.Albums.FirstOrDefault(i => string.Equals(i.Key, releaseId, StringComparison.OrdinalIgnoreCase) || string.Equals(i.Key, releaseGroupId, StringComparison.OrdinalIgnoreCase));
var albumcovers = album.Value.AlbumCovers;
var cdarts = album.Value.CdArts;
var album = obj.Albums.FirstOrDefault(i => string.Equals(i.ReleaseGroupId, releaseId, StringComparison.OrdinalIgnoreCase) || string.Equals(i.ReleaseGroupId, releaseGroupId, StringComparison.OrdinalIgnoreCase));
var albumcovers = album?.AlbumCovers;
var cdarts = album?.CdArts;
if (albumcovers != null)
{