mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
fix: object review videos
This commit is contained in:
1 parent
22faa6d294
commit
4ff8d77460
2 files changed
+30
-25
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
Video,
|
||||
youtubers,
|
||||
} from "@blitzkit/core";
|
||||
import locales from "@blitzkit/i18n/locales.json";
|
||||
import { google } from "googleapis";
|
||||
import { cloneDeep, uniqBy } from "lodash-es";
|
||||
import { AssetUploader } from "./core/github/assetUploader";
|
||||
@@ -42,9 +43,11 @@ for (const tank of tanksSanitized) {
|
||||
}
|
||||
|
||||
try {
|
||||
const q = `World of Tanks Blitz ${tank.name.locales[locales.default]}`;
|
||||
|
||||
const results = await youtube.search.list({
|
||||
part: ["snippet"],
|
||||
q: `World of Tanks Blitz ${tank.name}`,
|
||||
q,
|
||||
});
|
||||
|
||||
if (!results.data.items || results.data.items.length === 0) continue;
|
||||
@@ -54,9 +57,9 @@ for (const tank of tanksSanitized) {
|
||||
(item) =>
|
||||
item.snippet?.channelId &&
|
||||
item.id?.videoId &&
|
||||
youtubers.some(({ id }) => id === item.snippet?.channelId)
|
||||
youtubers.some(({ id }) => id === item.snippet?.channelId),
|
||||
),
|
||||
(item) => item.snippet!.channelId
|
||||
(item) => item.snippet!.channelId,
|
||||
);
|
||||
|
||||
reviews.reviews[tank.id] = {
|
||||
@@ -66,11 +69,13 @@ for (const tank of tanksSanitized) {
|
||||
({
|
||||
id: item.id!.videoId!,
|
||||
author: item.snippet!.channelId!,
|
||||
} satisfies Video)
|
||||
}) satisfies Video,
|
||||
),
|
||||
};
|
||||
|
||||
console.log(`${++done} done; found ${items.length} for ${tank.name.locales.en}`);
|
||||
console.log(
|
||||
`${++done} done; found ${items.length} for ${tank.name.locales.en}`,
|
||||
);
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000 / 5));
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { youtubers } from '@blitzkit/core';
|
||||
import { Box, Flex, Heading, Link, Skeleton, Text } from '@radix-ui/themes';
|
||||
import { awaitableReviews } from '../../core/awaitables/reviews';
|
||||
import { Var } from '../../core/radix/var';
|
||||
import { useLocale } from '../../hooks/useLocale';
|
||||
import { Duel } from '../../stores/duel';
|
||||
import type { MaybeSkeletonComponentProps } from '../../types/maybeSkeletonComponentProps';
|
||||
import { PageWrapper } from '../PageWrapper';
|
||||
import { VerifiedIcon } from '../VerifiedIcon';
|
||||
import { youtubers } from "@blitzkit/core";
|
||||
import { Box, Flex, Heading, Link, Skeleton, Text } from "@radix-ui/themes";
|
||||
import { awaitableReviews } from "../../core/awaitables/reviews";
|
||||
import { Var } from "../../core/radix/var";
|
||||
import { useLocale } from "../../hooks/useLocale";
|
||||
import { Duel } from "../../stores/duel";
|
||||
import type { MaybeSkeletonComponentProps } from "../../types/maybeSkeletonComponentProps";
|
||||
import { PageWrapper } from "../PageWrapper";
|
||||
import { VerifiedIcon } from "../VerifiedIcon";
|
||||
|
||||
const reviews = await awaitableReviews;
|
||||
|
||||
@@ -47,22 +47,22 @@ export function VideoSection({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
<Flex
|
||||
direction="column"
|
||||
style={{
|
||||
borderRadius: 'var(--radius-3)',
|
||||
overflow: 'hidden',
|
||||
borderRadius: "var(--radius-3)",
|
||||
overflow: "hidden",
|
||||
background: skeleton
|
||||
? Var('color-panel-solid')
|
||||
? Var("color-panel-solid")
|
||||
: `url(${image})`,
|
||||
backgroundPosition: '0 18px',
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: "0 18px",
|
||||
backgroundSize: "cover",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
style={{
|
||||
background: skeleton ? 'transparent' : `url(${image})`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
background: skeleton ? "transparent" : `url(${image})`,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: "center",
|
||||
height: 128,
|
||||
aspectRatio: '16 / 9',
|
||||
aspectRatio: "16 / 9",
|
||||
}}
|
||||
/>
|
||||
<Flex
|
||||
@@ -70,8 +70,8 @@ export function VideoSection({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
width="100%"
|
||||
justify="center"
|
||||
style={{
|
||||
backdropFilter: 'blur(4rem)',
|
||||
WebkitBackdropFilter: 'blur(4rem)',
|
||||
backdropFilter: "blur(4rem)",
|
||||
WebkitBackdropFilter: "blur(4rem)",
|
||||
}}
|
||||
align="center"
|
||||
gap="1"
|
||||
|
||||
Reference in new issue
Block a user