Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
99dcdd2
1
Parent(s):
ee69336
now like detection works
Browse files
src/app/server/actions/stats.ts
CHANGED
@@ -87,10 +87,10 @@ export async function getVideoRating(videoId: string, apiKey?: string): Promise<
|
|
87 |
const credentials = { accessToken: apiKey }
|
88 |
|
89 |
const user = await whoAmI({ credentials }) as unknown as WhoAmIUser
|
90 |
-
const isLiked = await redis.get(`users:${user.id}:
|
91 |
if (isLiked !== null) {
|
92 |
-
isLikedByUser =
|
93 |
-
isDislikedByUser = !
|
94 |
}
|
95 |
} catch (err) {
|
96 |
console.error("failed to get user like status")
|
|
|
87 |
const credentials = { accessToken: apiKey }
|
88 |
|
89 |
const user = await whoAmI({ credentials }) as unknown as WhoAmIUser
|
90 |
+
const isLiked = await redis.get<boolean>(`users:${user.id}:activity:videos:${videoId}:liked`)
|
91 |
if (isLiked !== null) {
|
92 |
+
isLikedByUser = !!isLiked
|
93 |
+
isDislikedByUser = !isLiked
|
94 |
}
|
95 |
} catch (err) {
|
96 |
console.error("failed to get user like status")
|