Skip to content

Commit

Permalink
Add parse bvID from window
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Jun 28, 2024
1 parent 0cdaec4 commit e77a32d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion maze-utils
4 changes: 2 additions & 2 deletions src/utils/thumbnails.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseBilibiliVideoIDFromURL } from "../../maze-utils/src/video";
import { getBvIDFromURL } from "../../maze-utils/src/video";
import Config from "../config";
import { getVideoLabel } from "./videoLabels";
import { setThumbnailListener } from "../../maze-utils/src/thumbnailManagement";
Expand All @@ -17,7 +17,7 @@ export async function labelThumbnail(thumbnail: HTMLImageElement): Promise<HTMLE
// find all links in the thumbnail, reduce to only one video ID
const links = Array.from(thumbnail.querySelectorAll("a[href]")) as Array<HTMLAnchorElement>;
const videoIDs = new Set(links.filter((link) => link && link.href)
.map((link) => parseBilibiliVideoIDFromURL(link.href)?.videoID)
.map((link) => getBvIDFromURL(link.href))
.filter((id) => id));
if (videoIDs.size !== 1) {
// none or multiple video IDs found
Expand Down

0 comments on commit e77a32d

Please sign in to comment.