We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2853490 commit 4f5882dCopy full SHA for 4f5882d
1 file changed
src/actions/ytFeed.ts
@@ -71,14 +71,12 @@ export function ytFeed(client: Client) {
71
const data = jsonFromXML<YTFeedData>(rawBody);
72
const { entry } = data.feed;
73
74
- if (!entry) return log("yellow", "Missing entry data");
+ if (!entry) return;
75
76
const videoId = entry["yt:videoId"]._text;
77
const publishUnix = new Date(entry.published._text).getTime();
78
79
- if ((Date.now() - publishUnix) > MAX_CACHE_AGE) return log("yellow", `Skipped ${videoId}; age over ${MAX_CACHE_AGE.toLocaleString()}ms`);
80
-
81
- if (client.ytCache.has(videoId)) return log("yellow", `Skipped ${videoId}; already cached`);
+ if (((Date.now() - publishUnix) > MAX_CACHE_AGE) || client.ytCache.has(videoId)) return;
82
83
client.ytCache.add(videoId);
84
0 commit comments