Skip to content

Commit

Permalink
chore: Refactor queue() API to use ArchivedItem interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovler-Young committed Jun 24, 2024
1 parent 810bf19 commit bb05561
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib/server/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { None, Option, Some } from "ts-results-es";
import Bvid from "../bv.js";
import { XMLParser } from "fast-xml-parser";

interface ArchivedItem {
added_time: number;
bvid: string;
status: string;
}

export class BiliArchiver {
endpoint: URL;

Expand Down Expand Up @@ -32,7 +39,7 @@ export class BiliArchiver {
const res = await fetch(url.toString());
const items = (await res.json())?.items;
// filter those not finished
return items.filter((item: any) => item.status !== "finished").map((item: any) => item.bvid);
return items.filter((item: ArchivedItem) => item.status !== "finished").map((item: ArchivedItem) => item.bvid);
} catch (e) {
console.error(e);
return [];
Expand Down

0 comments on commit bb05561

Please sign in to comment.