From c39e006b5c93c1dd1d545f5d99e87023699c6d05 Mon Sep 17 00:00:00 2001 From: Korbs Date: Sat, 7 Sep 2024 04:03:03 -0400 Subject: [PATCH] Replace player with official Zorn and check if comments are enabled or not --- source/src/pages/watch.astro | 48 ++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/source/src/pages/watch.astro b/source/src/pages/watch.astro index 21a9dc0..b06a6f8 100755 --- a/source/src/pages/watch.astro +++ b/source/src/pages/watch.astro @@ -1,15 +1,16 @@ --- -import { t, changeLanguage } from "i18next"; -import Base from "@layouts/Default.astro"; -import "@styles/video.scss"; +import { t, changeLanguage } from "i18next" +import Base from "@layouts/Default.astro" +import "@styles/video.scss" + // Configuration import { DEFAULT_MEDIA_PROXY, DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from '@utils/GetConfig' -import { Donate, Download, ShareIos, ThumbsUp, MediaVideo } from "@iconoir/vue"; +import { Donate, Download, ShareIos, ThumbsUp, MediaVideo } from "@iconoir/vue" // Components import Dialog from '@components/Dialog.astro' import Video from '@components/VideoItem.astro' -import Player from "@components/video-player/Player.astro"; +import { Zorn } from "@minpluto/zorn" // Fetch const SWV = Astro.url.href.split("watch?v=").pop(); @@ -21,6 +22,15 @@ const Views = video.viewCount; const VideoSeconds = video.lengthSeconds; let DescriptionFormat = Description.replaceAll("\n", "
"); +var CheckComments = console.log(comments) // If not found, disable comment section + +if (CheckComments = "{ error: 'Comments not found.' }") { + var EnableComments = false +} else { + var EnableComments = true +} + + // Format Published Date const DateFormat = new Date(UploadDate * 1000).toLocaleDateString(); @@ -74,10 +84,12 @@ if (EightK === true) { // 571 --- -
@@ -108,26 +120,24 @@ if (EightK === true) { // 571

{t("WATCH.COMMENTS")}

- { + {EnableComments ? comments.comments.map((comment) => (
- +
-

- {comment.author} - 2 Months - Ago -

+

{comment.author} - 2 Months Ago

{comment.contentHtml}

-

- {comment.likeCount} -

+

{comment.likeCount}

)) + : +

Comments are disabled on this video.

+ }