fix: try to remove timezone offseet in bisect

This commit is contained in:
alikia2x (寒寒) 2025-02-14 03:13:32 +08:00
parent 4b48357ab6
commit 7946cb6e96
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6

View File

@ -1,5 +1,5 @@
import { getLatestVideos } from "lib/net/getLatestVideos.ts";
import { HOUR, SECOND } from "$std/datetime/constants.ts";
import { SECOND } from "$std/datetime/constants.ts";
import { VideoListVideo } from "lib/net/bilibili.d.ts";
export async function getVideoPositionInNewList(timestamp: number): Promise<number | null | VideoListVideo[]> {
@ -19,7 +19,7 @@ export async function getVideoPositionInNewList(timestamp: number): Promise<numb
if (!lastVideo || !lastVideo.pubdate) {
break;
}
const lastTime = lastVideo.pubdate * SECOND + 8 * HOUR;
const lastTime = lastVideo.pubdate * SECOND
if (lastTime <= timestamp && highPage == 1) {
return videos;
}
@ -54,7 +54,7 @@ export async function getVideoPositionInNewList(timestamp: number): Promise<numb
hi = mid - 1;
continue;
}
const lastTime = lastVideo.pubdate * SECOND + 8 * HOUR;
const lastTime = lastVideo.pubdate * SECOND
if (lastTime > timestamp) {
lo = mid + 1;
} else {
@ -71,7 +71,7 @@ export async function getVideoPositionInNewList(timestamp: number): Promise<numb
if (!video.pubdate) {
continue;
}
const videoTime = video.pubdate * SECOND + 8 * HOUR;
const videoTime = video.pubdate * SECOND
if (videoTime > timestamp) {
indexInPage++;
} else {