mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 22:17:21 +03:00
Only check import duplicates against unsubmitted segments
This commit is contained in:
@@ -276,7 +276,7 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||||||
const importedSegments = importTimes(request.data, video.duration);
|
const importedSegments = importTimes(request.data, video.duration);
|
||||||
let addedSegments = false;
|
let addedSegments = false;
|
||||||
for (const segment of importedSegments) {
|
for (const segment of importedSegments) {
|
||||||
if (!sponsorTimesSubmitting.concat(sponsorTimes ?? []).some(
|
if (!sponsorTimesSubmitting.some(
|
||||||
(s) => Math.abs(s.segment[0] - segment.segment[0]) < 1
|
(s) => Math.abs(s.segment[0] - segment.segment[0]) < 1
|
||||||
&& Math.abs(s.segment[1] - segment.segment[1]) < 1)
|
&& Math.abs(s.segment[1] - segment.segment[1]) < 1)
|
||||||
&& (segment.category !== "chapter" || utils.getCategorySelection("chapter"))) {
|
&& (segment.category !== "chapter" || utils.getCategorySelection("chapter"))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user