Skip to content

Commit

Permalink
fix(cleanup): fix viewcount
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandebalthasar committed Nov 9, 2023
1 parent 158a4e6 commit 78d9b22
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions apps/trackflix/src/api/StrapiApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion apps/trackflix/src/pages/video/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit 78d9b22

Please sign in to comment.