mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 13:37:04 +03:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f5728d4db | ||
|
|
06fa2748fe | ||
|
|
8b50373eab | ||
|
|
bdedf86d63 | ||
|
|
0fb84dc03d | ||
|
|
041ccdaf11 | ||
|
|
1f967b3f69 | ||
|
|
07f0b87379 |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "__MSG_fullName__",
|
||||
"short_name": "SponsorBlock",
|
||||
"version": "3.1.1",
|
||||
"version": "3.1.2",
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_Description__",
|
||||
"homepage_url": "https://sponsor.ajay.app",
|
||||
|
||||
26181
package-lock.json
generated
26181
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -15,13 +15,13 @@ export interface SubmissionNoticeProps {
|
||||
closeListener: () => void;
|
||||
}
|
||||
|
||||
export interface SubmissionNoticeeState {
|
||||
export interface SubmissionNoticeState {
|
||||
noticeTitle: string,
|
||||
messages: string[],
|
||||
idSuffix: string;
|
||||
}
|
||||
|
||||
class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, SubmissionNoticeeState> {
|
||||
class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, SubmissionNoticeState> {
|
||||
// Contains functions and variables from the content script needed by the skip notice
|
||||
contentContainer: ContentContainer;
|
||||
|
||||
@@ -192,4 +192,4 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
|
||||
}
|
||||
}
|
||||
|
||||
export default SubmissionNoticeComponent;
|
||||
export default SubmissionNoticeComponent;
|
||||
|
||||
@@ -1059,7 +1059,7 @@ function getStartTimes(sponsorTimes: SponsorTime[], includeIntersectingSegments:
|
||||
const includedTimes: ScheduledTime[] = [];
|
||||
const startTimeIndexes: number[] = [];
|
||||
|
||||
const possibleTimes = sponsorTimes.flatMap((sponsorTime) => {
|
||||
const possibleTimes = sponsorTimes.map((sponsorTime) => {
|
||||
const results = [{
|
||||
...sponsorTime,
|
||||
scheduledTime: sponsorTime.segment[0]
|
||||
@@ -1074,7 +1074,7 @@ function getStartTimes(sponsorTimes: SponsorTime[], includeIntersectingSegments:
|
||||
}
|
||||
|
||||
return results;
|
||||
})
|
||||
}).reduce((a, b) => a.concat(b), []);
|
||||
|
||||
for (let i = 0; i < possibleTimes.length; i++) {
|
||||
if ((minimum === undefined
|
||||
@@ -1112,7 +1112,7 @@ function sendTelemetryAndCount(skippingSegments: SponsorTime[], secondsSkipped:
|
||||
|
||||
let counted = false;
|
||||
for (const segment of skippingSegments) {
|
||||
const index = sponsorTimes.indexOf(segment);
|
||||
const index = sponsorTimes.findIndex((s) => s.segment === segment.segment);
|
||||
if (index !== -1 && !sponsorSkipped[index]) {
|
||||
sponsorSkipped[index] = true;
|
||||
if (!counted) {
|
||||
|
||||
@@ -15,6 +15,7 @@ test("Selenium Chrome test", async () => {
|
||||
await editSegments(driver, 0, "0:04.000", "0:10.330", "5", "13.211", "0:05.000 to 0:13.211", false);
|
||||
await autoskipSegment(driver, 5, 13.211);
|
||||
|
||||
await setSegmentCategory(driver, 0, 1, false);
|
||||
await setSegmentActionType(driver, 0, 1, false);
|
||||
await editSegments(driver, 0, "0:05.000", "0:13.211", "5", "7.5", "0:05.000 to 0:07.500", false);
|
||||
await muteSkipSegment(driver, 5, 7.5);
|
||||
@@ -109,6 +110,16 @@ async function editSegments(driver: WebDriver, index: number, expectedStartTimeB
|
||||
await driver.wait(until.elementTextIs(sponsorTimeDisplay, expectedDisplayedTime));
|
||||
}
|
||||
|
||||
async function setSegmentCategory(driver: WebDriver, index: number, categoryIndex: number, openSubmitBox: boolean): Promise<void> {
|
||||
if (openSubmitBox) {
|
||||
const submitButton = await driver.findElement(By.id("submitButton"));
|
||||
await submitButton.click();
|
||||
}
|
||||
|
||||
const categorySelection = await driver.findElement(By.css(`#sponsorTimeCategoriesSubmissionNotice${index} > option:nth-child(${categoryIndex + 1})`));
|
||||
await categorySelection.click();
|
||||
}
|
||||
|
||||
async function setSegmentActionType(driver: WebDriver, index: number, actionTypeIndex: number, openSubmitBox: boolean): Promise<void> {
|
||||
if (openSubmitBox) {
|
||||
const submitButton = await driver.findElement(By.id("submitButton"));
|
||||
@@ -116,7 +127,7 @@ async function setSegmentActionType(driver: WebDriver, index: number, actionType
|
||||
}
|
||||
|
||||
const actionTypeSelection = await driver.findElement(By.css(`#sponsorTimeActionTypesSubmissionNotice${index} > option:nth-child(${actionTypeIndex + 1})`));
|
||||
actionTypeSelection.click();
|
||||
await actionTypeSelection.click();
|
||||
}
|
||||
|
||||
async function autoskipSegment(driver: WebDriver, startTime: number, endTime: number): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user