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..1dd7c62 100644 --- a/src/utils/youtube/fetchLatestUploads.ts +++ b/src/utils/youtube/fetchLatestUploads.ts @@ -117,15 +117,26 @@ 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; + console.log("Determined content type:", contentType); if (contentType) { console.log(