diff --git a/bun.lockb b/bun.lockb index 1e5e38a..542755c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/source/src/pages/discover.astro b/source/src/pages/discover.astro index c7ad92c..9782590 100755 --- a/source/src/pages/discover.astro +++ b/source/src/pages/discover.astro @@ -19,8 +19,6 @@ if (Astro.url.href.includes('?platform=youtube')) {var SelectedPlatform = "YouTu else if (Astro.url.href.includes('?platform=twitch')) {var SelectedPlatform = "Twitch"} var FullCategoryName = SearchQuery.charAt(0).toUpperCase() + SearchQuery.slice(1) - - // Fetch if (Astro.url.href.includes('?platform=youtube')) { var PlatformYouTube = true @@ -37,7 +35,23 @@ else if (Astro.url.href.includes('?platform=twitch')) { --- -

{FullCategoryName} on {SelectedPlatform}

+
+ {PlatformTwitch ? +
+

{TwitchData.data.displayName}

+

{TwitchData.data.viewers} Viewers

+
+

{TwitchData.data.description}

+ + : + null + } +

{PlatformYouTube ? @@ -69,4 +83,30 @@ else if (Astro.url.href.includes('?platform=twitch')) { null }
- \ No newline at end of file + + + \ No newline at end of file diff --git a/source/src/pages/watch.astro b/source/src/pages/watch.astro index 979331e..21a9dc0 100755 --- a/source/src/pages/watch.astro +++ b/source/src/pages/watch.astro @@ -20,8 +20,10 @@ const UploadDate = video.published; const Views = video.viewCount; const VideoSeconds = video.lengthSeconds; let DescriptionFormat = Description.replaceAll("\n", "
"); + // Format Published Date const DateFormat = new Date(UploadDate * 1000).toLocaleDateString(); + // Format Video Length // Thanks to "mingjunlu" for helping out with the time format new Date(VideoSeconds * 1000) @@ -30,6 +32,7 @@ new Date(VideoSeconds * 1000) .split(":") .map(Number) .join(":"); + // Format Views const ViewsConversion = Intl.NumberFormat("en", { notation: "compact" }); let ViewsFormat = ViewsConversion.format(Views);