mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
Import chapters as chooseACategory if chapters is disabled
This commit is contained in:
@@ -271,8 +271,13 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||||||
for (const segment of importedSegments) {
|
for (const segment of importedSegments) {
|
||||||
if (!sponsorTimesSubmitting.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"))) {
|
if (segment.category === "chapter" && !utils.getCategorySelection("chapter")) {
|
||||||
|
segment.category = "chooseACategory" as Category;
|
||||||
|
segment.actionType = ActionType.Skip;
|
||||||
|
segment.description = "";
|
||||||
|
}
|
||||||
|
|
||||||
sponsorTimesSubmitting.push(segment);
|
sponsorTimesSubmitting.push(segment);
|
||||||
addedSegments = true;
|
addedSegments = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user