Move some generic functions to a new package

This commit is contained in:
Ajay
2022-12-24 00:54:56 -05:00
parent 7bf17e1746
commit 7dd2c9eb3e
12 changed files with 71 additions and 106 deletions

View File

@@ -1,5 +1,5 @@
import { ActionType, Category, SponsorSourceType, SponsorTime, VideoID } from "../types";
import { GenericUtils } from "./genericUtils";
import { getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating";
export function getControls(): HTMLElement {
const controlsSelectors = [
@@ -80,7 +80,7 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
const timeElement = link.querySelector("#time") as HTMLElement;
const description = link.querySelector("#details h4") as HTMLElement;
if (timeElement && description?.innerText?.length > 0 && link.getAttribute("href")?.includes(currentVideoID)) {
const time = GenericUtils.getFormattedTimeToSeconds(timeElement.innerText);
const time = getFormattedTimeToSeconds(timeElement.innerText);
if (time === null) return [];
if (lastSegment) {