Fix missing userid generation call swaps

This commit is contained in:
Ajay
2023-02-18 22:44:34 -05:00
parent 4ca6a331f1
commit 4095ca8642
3 changed files with 7 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg"; import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
import PencilSvg from "../svg-icons/pencil_svg"; import PencilSvg from "../svg-icons/pencil_svg";
import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils"; import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { GenericUtils } from "../utils/genericUtils"; import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
enum SkipButtonState { enum SkipButtonState {
Undo, // Unskip Undo, // Unskip
@@ -542,7 +542,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
const sponsorVideoID = this.props.contentContainer().sponsorVideoID; const sponsorVideoID = this.props.contentContainer().sponsorVideoID;
const sponsorTimesSubmitting : SponsorTime = { const sponsorTimesSubmitting : SponsorTime = {
segment: this.segments[index].segment, segment: this.segments[index].segment,
UUID: GenericUtils.generateUserID() as SegmentUUID, UUID: generateUserID() as SegmentUUID,
category: this.segments[index].category, category: this.segments[index].category,
actionType: this.segments[index].actionType, actionType: this.segments[index].actionType,
source: SponsorSourceType.Local source: SponsorSourceType.Local

View File

@@ -42,6 +42,7 @@ import { setupVideoMutationListener, getChannelIDInfo, getVideo, refreshVideoAtt
import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config"; import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config";
import { findValidElement } from "@ajayyy/maze-utils/lib/dom" import { findValidElement } from "@ajayyy/maze-utils/lib/dom"
import { getHash, HashedValue } from "@ajayyy/maze-utils/lib/hash"; import { getHash, HashedValue } from "@ajayyy/maze-utils/lib/hash";
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
const utils = new Utils(); const utils = new Utils();
@@ -1786,7 +1787,7 @@ function startOrEndTimingNewSegment() {
if (!isSegmentCreationInProgress()) { if (!isSegmentCreationInProgress()) {
sponsorTimesSubmitting.push({ sponsorTimesSubmitting.push({
segment: [roundedTime], segment: [roundedTime],
UUID: GenericUtils.generateUserID() as SegmentUUID, UUID: generateUserID() as SegmentUUID,
category: Config.config.defaultCategory, category: Config.config.defaultCategory,
actionType: ActionType.Skip, actionType: ActionType.Skip,
source: SponsorSourceType.Local source: SponsorSourceType.Local
@@ -2393,7 +2394,7 @@ function checkForPreloadedSegment() {
if (!sponsorTimesSubmitting.some((s) => s.segment[0] === segment.segment[0] && s.segment[1] === s.segment[1])) { if (!sponsorTimesSubmitting.some((s) => s.segment[0] === segment.segment[0] && s.segment[1] === s.segment[1])) {
sponsorTimesSubmitting.push({ sponsorTimesSubmitting.push({
segment: segment.segment, segment: segment.segment,
UUID: GenericUtils.generateUserID() as SegmentUUID, UUID: generateUserID() as SegmentUUID,
category: segment.category ? segment.category : Config.config.defaultCategory, category: segment.category ? segment.category : Config.config.defaultCategory,
actionType: segment.actionType ? segment.actionType : ActionType.Skip, actionType: segment.actionType ? segment.actionType : ActionType.Skip,
description: segment.description ?? "", description: segment.description ?? "",

View File

@@ -1,8 +1,8 @@
import { ActionType, Category, SegmentUUID, SponsorSourceType, SponsorTime } from "../types"; import { ActionType, Category, SegmentUUID, SponsorSourceType, SponsorTime } from "../types";
import { shortCategoryName } from "./categoryUtils"; import { shortCategoryName } from "./categoryUtils";
import { GenericUtils } from "./genericUtils";
import * as CompileConfig from "../../config.json"; import * as CompileConfig from "../../config.json";
import { getFormattedTime, getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating"; import { getFormattedTime, getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating";
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
const inTest = typeof chrome === "undefined"; const inTest = typeof chrome === "undefined";
@@ -62,7 +62,7 @@ export function importTimes(data: string, videoDuration: number): SponsorTime[]
actionType: determinedCategory ? ActionType.Skip : ActionType.Chapter, actionType: determinedCategory ? ActionType.Skip : ActionType.Chapter,
description: title, description: title,
source: SponsorSourceType.Local, source: SponsorSourceType.Local,
UUID: GenericUtils.generateUserID() as SegmentUUID UUID: generateUserID() as SegmentUUID
}; };
if (result.length > 0 && result[result.length - 1].segment[1] === null) { if (result.length > 0 && result[result.length - 1].segment[1] === null) {