diff --git a/src/app/watch/Watch.tsx b/src/app/watch/Watch.tsx index dbef33d..16fbc53 100644 --- a/src/app/watch/Watch.tsx +++ b/src/app/watch/Watch.tsx @@ -3,6 +3,11 @@ import { useQuery } from "@tanstack/react-query"; import { useSearchParams } from "next/navigation"; import { useMemo } from "react"; +import { + FiThumbsDown as DislikeIcon, + FiThumbsUp as LikeIcon, + FiEye as ViewIcon +} from "react-icons/fi"; import { Chip } from "@nextui-org/chip"; @@ -64,10 +69,19 @@ export const Watch: Component = () => {

{data.video.title}

-

{formatBigNumber(data.video.views)} views

+
+ +

{formatBigNumber(data.video.views)} views

+
-

{formatBigNumber(data.likes)} likes

-

{formatBigNumber(data.dislikes)} dislikes

+
+ +

{formatBigNumber(data.likes)} likes

+
+
+ +

{formatBigNumber(data.dislikes)} dislikes

+
diff --git a/src/client/adapters/piped/index.ts b/src/client/adapters/piped/index.ts index b5d4ee7..15329cc 100644 --- a/src/client/adapters/piped/index.ts +++ b/src/client/adapters/piped/index.ts @@ -119,7 +119,7 @@ const getComments = async ( searchParams.append("nextpage", nextpage); } else url = new URL(path.join("comments", videoId), apiBaseUrl); - const response = await ky.get(url); + const response = await ky.get(url, { searchParams }); const json = await response.json(); @@ -168,11 +168,15 @@ const adapter: Adapter = { }, async getStream(videoId) { - return getStream(url, videoId).then(Transformer.stream); + return getStream(url, videoId).then((data) => + Transformer.stream(data, videoId) + ); }, - async getComments(videoId) { - return getComments(url, videoId).then(Transformer.comments); + async getComments(videoId, repliesToken?: string) { + return getComments(url, videoId, repliesToken).then( + Transformer.comments + ); } }; } diff --git a/src/client/adapters/piped/transformer.ts b/src/client/adapters/piped/transformer.ts index 6b46596..6bd7394 100644 --- a/src/client/adapters/piped/transformer.ts +++ b/src/client/adapters/piped/transformer.ts @@ -102,7 +102,7 @@ export default class Transformer { return { items, nextCursor: data.nextpage }; } - public static stream(data: PipedStream): Stream { + public static stream(data: PipedStream, videoId: string): Stream { const channelId = parseChannelIdFromUrl(data.uploaderUrl) ?? undefined; return { @@ -120,7 +120,7 @@ export default class Transformer { }, description: data.description, duration: data.duration * 1000, - id: "", + id: videoId, live: data.livestream, thumbnail: data.thumbnailUrl, title: data.title,