From 13f472d7d5f915b9d2da72e8b104f043897255bc Mon Sep 17 00:00:00 2001 From: ferferga Date: Tue, 9 Jun 2020 00:48:56 +0200 Subject: [PATCH] Fix episodes listing after blurhash --- src/components/listview/listview.js | 23 +++++++++++++---------- src/controllers/itemDetails.js | 3 ++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/listview/listview.js b/src/components/listview/listview.js index 7bafc925b2..392372dd1a 100644 --- a/src/components/listview/listview.js +++ b/src/components/listview/listview.js @@ -81,23 +81,26 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan options.tag = item.ImageTags.Primary; itemId = item.Id; } - - if (item.AlbumId && item.AlbumPrimaryImageTag) { - options.tag = item.AlbumPrimaryImageTag; - itemId = item.AlbumId; - } else if (item.SeriesId && item.SeriesPrimaryImageTag) { - options.tag = item.SeriesPrimaryImageTag; - itemId = item.SeriesId; - } else if (item.ParentPrimaryImageTag) { - options.tag = item.ParentPrimaryImageTag; - itemId = item.ParentPrimaryImageItemId; + if (!itemId) { + if (item.AlbumId && item.AlbumPrimaryImageTag) { + options.tag = item.AlbumPrimaryImageTag; + itemId = item.AlbumId; + } else if (item.SeriesId && item.SeriesPrimaryImageTag) { + options.tag = item.SeriesPrimaryImageTag; + itemId = item.SeriesId; + } else if (item.ParentPrimaryImageTag) { + options.tag = item.ParentPrimaryImageTag; + itemId = item.ParentPrimaryImageItemId; + } } + let blurHashes = item.ImageBlurHashes || {}; let blurhashstr = (blurHashes[options.type] || {})[options.tag]; if (itemId) { return { url: apiClient.getScaledImageUrl(itemId, options), blurhash: blurhashstr }; } + return null; } function getChannelImageUrl(item, width) { diff --git a/src/controllers/itemDetails.js b/src/controllers/itemDetails.js index cbb8a1b43e..01f618750f 100644 --- a/src/controllers/itemDetails.js +++ b/src/controllers/itemDetails.js @@ -1840,7 +1840,8 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti chaptercardbuilder.buildChapterCards(item, chapters, { itemsContainer: scenesContent, backdropShape: 'overflowBackdrop', - squareShape: 'overflowSquare' + squareShape: 'overflowSquare', + imageBlurhashes: item.ImageBlurHashes }); }); } else {