From 7e814870a32caf98af78d4f59e88fbe7d4676aa9 Mon Sep 17 00:00:00 2001 From: GalvinPython Date: Sat, 13 Sep 2025 11:55:46 +0100 Subject: [PATCH 1/2] fix: updates correct content type now --- package.json | 2 +- src/utils/youtube/fetchLatestUploads.ts | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 437965f..062f360 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "feedr", "module": "src/index.ts", "type": "module", - "version": "2.0.0-dev", + "version": "2.0.0-hotfix.1", "devDependencies": { "@types/bun": "1.2.21", "@types/pg": "^8.11.14", diff --git a/src/utils/youtube/fetchLatestUploads.ts b/src/utils/youtube/fetchLatestUploads.ts index 491d4ad..85af58d 100644 --- a/src/utils/youtube/fetchLatestUploads.ts +++ b/src/utils/youtube/fetchLatestUploads.ts @@ -117,15 +117,30 @@ export default async function fetchLatestUploads() { let contentType: PlaylistType | null = null; + if (videoId == longVideoId.videoId) { + contentType = PlaylistType.Video; + } else if (videoId == shortVideoId.videoId) { + contentType = PlaylistType.Short; + } else if (videoId == streamVideoId.videoId) { + contentType = PlaylistType.Stream; + } else { + console.error( + "Video ID does not match any fetched video IDs for channel", + channelId, + ); + } + const videoIdMap = { [PlaylistType.Video]: longVideoId, [PlaylistType.Short]: shortVideoId, [PlaylistType.Stream]: streamVideoId, }; - contentType = Object.entries(videoIdMap).find( - ([, id]) => id, - )?.[0] as PlaylistType | null; + // contentType = Object.entries(videoIdMap).find( + // ([, id]) => id, + // )?.[0] as PlaylistType | null; + + console.log("Determined content type:", contentType); if (contentType) { console.log( From ae4967c5567a0018816b0c458445ecfb7b35c142 Mon Sep 17 00:00:00 2001 From: Galvin Date: Sat, 13 Sep 2025 12:04:03 +0100 Subject: [PATCH 2/2] style: remove unused code Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/utils/youtube/fetchLatestUploads.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/utils/youtube/fetchLatestUploads.ts b/src/utils/youtube/fetchLatestUploads.ts index 85af58d..1dd7c62 100644 --- a/src/utils/youtube/fetchLatestUploads.ts +++ b/src/utils/youtube/fetchLatestUploads.ts @@ -136,10 +136,6 @@ export default async function fetchLatestUploads() { [PlaylistType.Stream]: streamVideoId, }; - // contentType = Object.entries(videoIdMap).find( - // ([, id]) => id, - // )?.[0] as PlaylistType | null; - console.log("Determined content type:", contentType); if (contentType) {