Compare commits

..

8 Commits
3.1.1 ... 3.1.2

Author SHA1 Message Date
Ajay Ramachandran
7f5728d4db bump version 2021-09-07 23:28:48 -04:00
Ajay Ramachandran
06fa2748fe Fix package-lock, fix #937 2021-09-07 18:54:37 -04:00
Ajay Ramachandran
8b50373eab Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2021-09-06 23:51:28 -04:00
Ajay Ramachandran
bdedf86d63 Fix selenium test to change category 2021-09-06 23:51:26 -04:00
Ajay Ramachandran
0fb84dc03d Merge pull request #934 from KarelVerschraegen/patch-2
Fix typo in SubmissionNoticeComponent
2021-09-06 16:11:03 -04:00
Ajay Ramachandran
041ccdaf11 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2021-09-06 16:10:34 -04:00
Ajay Ramachandran
1f967b3f69 Fix skips not being counted and crash on old browser 2021-09-06 16:10:32 -04:00
KarelVerschraegen
07f0b87379 Fix typo in SubmissionNoticeComponent 2021-09-06 15:50:13 +02:00
5 changed files with 232 additions and 25976 deletions

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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> {