Skip to content

Commit 90f2fbf

Browse files
authored
Merge pull request #187 from GalvinPython/fix/content-type
2 parents a6b36b2 + ae4967c commit 90f2fbf

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "feedr",
33
"module": "src/index.ts",
44
"type": "module",
5-
"version": "2.0.0-dev",
5+
"version": "2.0.0-hotfix.1",
66
"devDependencies": {
77
"@types/bun": "1.2.21",
88
"@types/pg": "^8.11.14",

src/utils/youtube/fetchLatestUploads.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,26 @@ export default async function fetchLatestUploads() {
117117

118118
let contentType: PlaylistType | null = null;
119119

120+
if (videoId == longVideoId.videoId) {
121+
contentType = PlaylistType.Video;
122+
} else if (videoId == shortVideoId.videoId) {
123+
contentType = PlaylistType.Short;
124+
} else if (videoId == streamVideoId.videoId) {
125+
contentType = PlaylistType.Stream;
126+
} else {
127+
console.error(
128+
"Video ID does not match any fetched video IDs for channel",
129+
channelId,
130+
);
131+
}
132+
120133
const videoIdMap = {
121134
[PlaylistType.Video]: longVideoId,
122135
[PlaylistType.Short]: shortVideoId,
123136
[PlaylistType.Stream]: streamVideoId,
124137
};
125138

126-
contentType = Object.entries(videoIdMap).find(
127-
([, id]) => id,
128-
)?.[0] as PlaylistType | null;
139+
console.log("Determined content type:", contentType);
129140

130141
if (contentType) {
131142
console.log(

0 commit comments

Comments
 (0)