mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-19 14:09:06 +03:00
- drop videoInfo.genreUrl since it's always empty - bump ts target to ES2021 for Promise.any - fix mocks to return err: false - get maxResThumbnail from static endpoint
18 lines
693 B
TypeScript
18 lines
693 B
TypeScript
import redis from "../utils/redis";
|
|
import { tempVIPKey } from "../utils/redisKeys";
|
|
import { HashedUserID } from "../types/user.model";
|
|
import { VideoID } from "../types/segments.model";
|
|
import { Logger } from "./logger";
|
|
import { getVideoDetails } from "./getVideoDetails";
|
|
|
|
export const isUserTempVIP = async (hashedUserID: HashedUserID, videoID: VideoID): Promise<boolean> => {
|
|
const apiVideoDetails = await getVideoDetails(videoID);
|
|
const channelID = apiVideoDetails?.authorId;
|
|
try {
|
|
const reply = await redis.get(tempVIPKey(hashedUserID));
|
|
return reply && reply == channelID;
|
|
} catch (e) {
|
|
Logger.error(e as string);
|
|
return false;
|
|
}
|
|
}; |