From 2a3467a737f8d48741fbc72dddce108802f4cc6a Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Sat, 21 Feb 2026 20:52:10 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=94=20feat:=20add=20logic=20to=20repla?= =?UTF-8?q?ce=20placeholder=20with=20thumbnail=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../http/updateAllEpisodeThumbnail.service.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/modules/internal/services/http/updateAllEpisodeThumbnail.service.ts b/src/modules/internal/services/http/updateAllEpisodeThumbnail.service.ts index 2478c29..1c47c1e 100644 --- a/src/modules/internal/services/http/updateAllEpisodeThumbnail.service.ts +++ b/src/modules/internal/services/http/updateAllEpisodeThumbnail.service.ts @@ -19,7 +19,20 @@ export const updateAllEpisodeThumbnailService = async ( "No episode with no thumbnail found in the specified video service.", ); - return videosData; + const updatePayload = videosData.map((videoService) => { + const { endpointThumbnail, videos } = videoService; + return videos + .filter((video) => video.thumbnailCode !== null) + .map((video) => ({ + episodeId: video.episode.id, + thumbnailCode: endpointThumbnail?.replace( + ":code:", + video.thumbnailCode!, + ), + })); + }); + + return updatePayload; } catch (error) { ErrorForwarder(error); }