1
0

fix: reading wrong properties from cache

This commit is contained in:
alikia2x (寒寒) 2025-12-10 14:12:38 +08:00
parent 1835591052
commit 6ba93a55e2
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 56209E0CCD8420C6
5 changed files with 19 additions and 15 deletions

4
.gitignore vendored
View File

@ -45,4 +45,6 @@ ucaptcha-config.yaml
temp/
meili
meili
datasets

View File

@ -91,7 +91,7 @@ const getVideoSearchResult = async (searchQuery: string) => {
return [
{
type: "bili-video" as "bili-video",
data: data.data,
data: data,
rank: 0.99 // Exact match
}
];

View File

@ -1,6 +1,6 @@
import { Elysia, t } from "elysia";
import { Elysia } from "elysia";
import { db, videoSnapshot } from "@core/drizzle";
import { biliIDToAID, bv2av } from "@backend/lib/bilibiliID";
import { biliIDToAID } from "@backend/lib/bilibiliID";
import { getVideoInfo } from "@core/net/getVideoInfo";
import { redis } from "@core/db/redis";
import { ErrorResponseSchema } from "@backend/src/schema";
@ -84,7 +84,7 @@ export const getVideoMetadataHandler = new Elysia({ prefix: "/video" }).get(
},
{
response: {
200: t.Any(),
200: BiliAPIVideoMetadataSchema,
400: ErrorResponseSchema,
500: ErrorResponseSchema
},

View File

@ -2,11 +2,6 @@ import { sql } from "@core/db/dbNew";
import logger from "@core/log";
export async function removeAllTimeoutSchedules() {
logger.log(
"Too many timeout schedules, directly removing these schedules...",
"mq",
"fn:removeAllTimeoutSchedules"
);
return sql`
WITH deleted AS (
DELETE FROM snapshot_schedule

View File

@ -88,10 +88,10 @@ export default function VideoInfo({ loaderData }: Route.ComponentProps) {
<p>
<span> {formatDateTime(new Date(videoInfo!.pubdate * 1000))}</span>
</p>
<p>
<span>{(videoInfo!.stat?.view ?? 0).toLocaleString()}</span> ·{" "}
<span>{(videoInfo!.stat?.danmaku ?? 0).toLocaleString()}</span>
</p>
<p>
<span>{(videoInfo!.stat?.view ?? 0).toLocaleString()}</span> ·{" "}
<span>{(videoInfo!.stat?.danmaku ?? 0).toLocaleString()}</span>
</p>
<p>
<span>
: {videoInfo!.tname}, tid{videoInfo!.tid}
@ -105,7 +105,14 @@ export default function VideoInfo({ loaderData }: Route.ComponentProps) {
</>
)}
</p>
<p>UP主<a className="underline" href={`https://space.bilibili.com/${videoInfo!.owner.mid}`}>{videoInfo!.owner.name}</a></p>
{videoInfo!.owner && (
<p>
UP主
<a className="underline" href={`https://space.bilibili.com/${videoInfo!.owner.mid}`}>
{videoInfo!.owner.name}
</a>
</p>
)}
</div>
</div>