mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-09 16:52:14 +01:00
Warn if server-side ad wasn't detected and submitting a segment
This commit is contained in:
parent
4bbd59b988
commit
116190f2b3
4 changed files with 10 additions and 4 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 28a41ee8335750fd16eed1d3a818f9f9e0aaf6a2
|
||||
Subproject commit 3c7787897e1e65cf6b55e76f39c43f4ed081d24e
|
|
@ -1 +1 @@
|
|||
Subproject commit becf2e3f14983eae390d182ded0ac7897048e20c
|
||||
Subproject commit 7cedce215851872be28bd50a9f690b680dd54442
|
|
@ -9,7 +9,7 @@ import NoticeTextSelectionComponent from "./NoticeTextSectionComponent";
|
|||
import SponsorTimeEditComponent from "./SponsorTimeEditComponent";
|
||||
import { getGuidelineInfo } from "../utils/constants";
|
||||
import { exportTimes } from "../utils/exporter";
|
||||
import { getVideo } from "../../maze-utils/src/video";
|
||||
import { getVideo, isCurrentTimeWrong } from "../../maze-utils/src/video";
|
||||
|
||||
export interface SubmissionNoticeProps {
|
||||
// Contains functions and variables from the content script needed by the skip notice
|
||||
|
@ -216,6 +216,11 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
|
|||
}
|
||||
|
||||
submit(): void {
|
||||
if (isCurrentTimeWrong()) {
|
||||
alert(chrome.i18n.getMessage("submissionFailedServerSideAds"));
|
||||
return;
|
||||
}
|
||||
|
||||
// save all items
|
||||
for (const ref of this.timeEditRefs) {
|
||||
ref.current.saveEditTimes();
|
||||
|
|
|
@ -34,7 +34,7 @@ import { ChapterVote } from "./render/ChapterVote";
|
|||
import { openWarningDialog } from "./utils/warnings";
|
||||
import { isFirefoxOrSafari, waitFor } from "../maze-utils/src";
|
||||
import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
|
||||
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube, getLastNonInlineVideoID, triggerVideoIDChange, triggerVideoElementChange, getIsInline, getCurrentTime, setCurrentTime, getVideoDuration } from "../maze-utils/src/video";
|
||||
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube, getLastNonInlineVideoID, triggerVideoIDChange, triggerVideoElementChange, getIsInline, getCurrentTime, setCurrentTime, getVideoDuration, verifyCurrentTime } from "../maze-utils/src/video";
|
||||
import { Keybind, StorageChangesObject, isSafari, keybindEquals, keybindToString } from "../maze-utils/src/config";
|
||||
import { findValidElement } from "../maze-utils/src/dom"
|
||||
import { getHash, HashedValue } from "../maze-utils/src/hash";
|
||||
|
@ -1962,6 +1962,7 @@ function getRealCurrentTime(): number {
|
|||
}
|
||||
|
||||
function startOrEndTimingNewSegment() {
|
||||
verifyCurrentTime();
|
||||
const roundedTime = Math.round((getRealCurrentTime() + Number.EPSILON) * 1000) / 1000;
|
||||
if (!isSegmentCreationInProgress()) {
|
||||
sponsorTimesSubmitting.push({
|
||||
|
|
Loading…
Reference in a new issue