Guess correct Thumb image size (#52)
Some checks failed
🏗️ Build Plugin / call (push) Has been cancelled
📝 Create/Update Release Draft & Release Bump PR / call (push) Has been cancelled
🔬 Run CodeQL / call (push) Has been cancelled
🧪 Test Plugin / call (push) Has been cancelled

This commit is contained in:
enter-a-random-username 2024-11-04 13:50:01 +01:00 committed by GitHub
parent 3e8d44f276
commit 19f5d471c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 39 additions and 2 deletions

View File

@ -10,6 +10,15 @@ namespace Jellyfin.Plugin.Fanart.Dtos
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("width")]
public int Width { get; set; }
[JsonPropertyName("height")]
public int Height { get; set; }
[JsonPropertyName("added")]
public string Added { get; set; }
[JsonPropertyName("likes")]
public string Likes { get; set; }

View File

@ -10,6 +10,15 @@ namespace Jellyfin.Plugin.Fanart.Dtos
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("width")]
public int Width { get; set; }
[JsonPropertyName("height")]
public int Height { get; set; }
[JsonPropertyName("added")]
public string Added { get; set; }
[JsonPropertyName("lang")]
public string Language { get; set; }

View File

@ -11,6 +11,15 @@ namespace Jellyfin.Plugin.Fanart.Dtos
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("width")]
public int Width { get; set; }
[JsonPropertyName("height")]
public int Height { get; set; }
[JsonPropertyName("added")]
public string Added { get; set; }
[JsonPropertyName("lang")]
public string Language { get; set; }

View File

@ -138,7 +138,7 @@ namespace Jellyfin.Plugin.Fanart.Providers
{
PopulateImages(list, obj.SeasonPosters, ImageType.Primary, 1000, 1426, seasonNumber);
PopulateImages(list, obj.SeasonBanners, ImageType.Banner, 1000, 185, seasonNumber);
PopulateImages(list, obj.SeasonThumbs, ImageType.Thumb, 500, 281, seasonNumber);
PopulateImages(list, obj.SeasonThumbs, ImageType.Thumb, 1000, 562, seasonNumber);
PopulateImages(list, obj.Showbackgrounds, ImageType.Backdrop, 1920, 1080, seasonNumber);
}
@ -184,6 +184,11 @@ namespace Jellyfin.Plugin.Fanart.Providers
info.CommunityRating = likes;
}
if (type == ImageType.Thumb && DateTime.Parse(i.Added, null) < new DateTime(2016,1,1)) {
info.Width = 500;
info.Height = 281;
}
return info;
}

View File

@ -154,7 +154,7 @@ namespace Jellyfin.Plugin.Fanart.Providers
PopulateImages(list, obj.ClearArts, ImageType.Art, 500, 281);
PopulateImages(list, obj.Showbackgrounds, ImageType.Backdrop, 1920, 1080, true);
PopulateImages(list, obj.SeasonThumbs, ImageType.Thumb, 500, 281);
PopulateImages(list, obj.TvThumbs, ImageType.Thumb, 500, 281);
PopulateImages(list, obj.TvThumbs, ImageType.Thumb, 1000, 562);
PopulateImages(list, obj.TvBanners, ImageType.Banner, 1000, 185);
PopulateImages(list, obj.TvPosters, ImageType.Primary, 1000, 1426);
}
@ -201,6 +201,11 @@ namespace Jellyfin.Plugin.Fanart.Providers
info.CommunityRating = likes;
}
if (type == ImageType.Thumb && DateTime.Parse(i.Added, null) < new DateTime(2016,1,8)) {
info.Width = 500;
info.Height = 281;
}
return info;
}