From 78d9b22b38e75837ab05ac11fb54ccbfe8b74ae9 Mon Sep 17 00:00:00 2001 From: Nathan de Balthasar Date: Thu, 9 Nov 2023 12:56:37 +0100 Subject: [PATCH] fix(cleanup): fix viewcount --- apps/trackflix/src/api/StrapiApi.ts | 2 -- apps/trackflix/src/pages/video/[id].tsx | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/trackflix/src/api/StrapiApi.ts b/apps/trackflix/src/api/StrapiApi.ts index a893601..0406384 100644 --- a/apps/trackflix/src/api/StrapiApi.ts +++ b/apps/trackflix/src/api/StrapiApi.ts @@ -123,8 +123,6 @@ export class StrapiApi implements IApi { }, }).then((res) => res.json()) - console.log(response) - const video = response.data if (!video) return null return this.strapiMediaToVideoOnDemand(video) diff --git a/apps/trackflix/src/pages/video/[id].tsx b/apps/trackflix/src/pages/video/[id].tsx index 2edf0f8..33b6d8a 100644 --- a/apps/trackflix/src/pages/video/[id].tsx +++ b/apps/trackflix/src/pages/video/[id].tsx @@ -161,7 +161,7 @@ const VideoPage = (props: PageProps) => { videoNode?.addEventListener( 'play', () => { - if (asset?.media?.id && asset?.media?.viewCount) { + if (asset?.media?.id && asset?.media?.viewCount !== undefined) { api.updateAsset(asset?.media?.id, { views: asset?.media?.viewCount + 1 || 1, })