Import chapters as chooseACategory if chapters is disabled

This commit is contained in:
Ajay 2022-10-17 09:23:59 -04:00
parent b52132e311
commit 5209c0ea04

View file

@ -271,8 +271,13 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
for (const segment of importedSegments) {
if (!sponsorTimesSubmitting.some(
(s) => Math.abs(s.segment[0] - segment.segment[0]) < 1
&& Math.abs(s.segment[1] - segment.segment[1]) < 1)
&& (segment.category !== "chapter" || utils.getCategorySelection("chapter"))) {
&& Math.abs(s.segment[1] - segment.segment[1]) < 1)) {
if (segment.category === "chapter" && !utils.getCategorySelection("chapter")) {
segment.category = "chooseACategory" as Category;
segment.actionType = ActionType.Skip;
segment.description = "";
}
sponsorTimesSubmitting.push(segment);
addedSegments = true;
}