Skip to content

Commit 70db0ea

Browse files
authored
Merge branch 'DIYgod:master' into master
2 parents aac941d + e06a6de commit 70db0ea

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

lib/routes/youtube/utils.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,22 @@ export async function getSubscriptionsRecusive(part, nextPageToken?) {
118118
// taken from https://webapps.stackexchange.com/a/101153
119119
export const isYouTubeChannelId = (id) => /^UC[\w-]{21}[AQgw]$/.test(id);
120120
export const getLive = (id, cache) =>
121-
cache.tryGet(`youtube:getLive:${id}`, async () => {
122-
const res = await exec((youtube) =>
123-
youtube.search.list({
124-
part: 'snippet',
125-
channelId: id,
126-
eventType: 'live',
127-
type: 'video',
128-
})
129-
);
130-
return res;
131-
});
121+
cache.tryGet(
122+
`youtube:getLive:${id}`,
123+
async () => {
124+
const res = await exec((youtube) =>
125+
youtube.search.list({
126+
part: 'snippet',
127+
channelId: id,
128+
eventType: 'live',
129+
type: 'video',
130+
})
131+
);
132+
return res;
133+
},
134+
config.cache.routeExpire,
135+
false
136+
);
132137
export const getVideoUrl = (id: string) => `https://www.youtube-nocookie.com/embed/${id}?controls=1&autoplay=1&mute=0`;
133138

134139
// Get the appropriate playlist ID with or without shorts

0 commit comments

Comments
 (0)