From b7e6e7a612f2bddfac58c156148b387eade69016 Mon Sep 17 00:00:00 2001 From: Harshith Mohan <26010946+harshithmohan@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:05:38 +0530 Subject: [PATCH] Revert "fix: order APIv3 Images DTO before sending" This reverts commit a2c0340c0084341acd3c72738cb5ba489c0fee50. --- Shoko.Server/API/v3/Helpers/APIv3_Extensions.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Shoko.Server/API/v3/Helpers/APIv3_Extensions.cs b/Shoko.Server/API/v3/Helpers/APIv3_Extensions.cs index c75401880..0a6615e98 100644 --- a/Shoko.Server/API/v3/Helpers/APIv3_Extensions.cs +++ b/Shoko.Server/API/v3/Helpers/APIv3_Extensions.cs @@ -83,15 +83,6 @@ public static Images ToDto(this IEnumerable imageList, IReadOnly if (includeThumbnails) SetPreferredOrDefaultImage(images.Thumbnails!, randomizeImages); } - else - { - images.Posters = OrderImages(images.Posters); - images.Backdrops = OrderImages(images.Backdrops); - images.Banners = OrderImages(images.Banners); - images.Logos = OrderImages(images.Logos); - if (includeThumbnails) - images.Thumbnails = OrderImages(images.Thumbnails!); - } return images; } @@ -106,13 +97,6 @@ private static void SetPreferredOrDefaultImage(List images, bool randomiz images.Add(poster); } - private static List OrderImages(List images) - => images - .OrderByDescending(image => image.Preferred) - .ThenBy(image => string.IsNullOrEmpty(image.LanguageCode)) - .ThenBy(image => (image.LanguageCode, image.Source, image.ID)) - .ToList(); - public static IReadOnlyList ToDto(this IEnumerable<TMDB_Title> titles, string? mainTitle = null, TMDB_Title? preferredTitle = null, IReadOnlySet<TitleLanguage>? language = null) { if (language != null && language.Count > 0)