diff options
author | Ajay <[email protected]> | 2024-04-26 16:44:20 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2024-04-26 16:44:20 -0400 |
commit | 56bb22d03d63ca6ae02aacb60562082dd82167ec (patch) | |
tree | bb98a7f738407b0b0108e03fa14bbbb4860cef21 /src/content.ts | |
parent | e1d656f43f8b3cfb40e1c521e4103d61db756872 (diff) | |
download | SponsorBlock-56bb22d03d63ca6ae02aacb60562082dd82167ec.tar.gz SponsorBlock-56bb22d03d63ca6ae02aacb60562082dd82167ec.zip |
Allow importing segments with no category
Also fixes case when importing chapters when having no permission to submit chapters
Diffstat (limited to 'src/content.ts')
-rw-r--r-- | src/content.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts index a7b8c45b..a48dca2b 100644 --- a/src/content.ts +++ b/src/content.ts @@ -303,7 +303,9 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo if (!sponsorTimesSubmitting.some( (s) => Math.abs(s.segment[0] - segment.segment[0]) < 1 && Math.abs(s.segment[1] - segment.segment[1]) < 1)) { - if (segment.category === "chapter" && !utils.getCategorySelection("chapter")) { + const hasChaptersPermission = (Config.config.showCategoryWithoutPermission + || Config.config.permissions["chapter"]); + if (segment.category === "chapter" && (!utils.getCategorySelection("chapter") || !hasChaptersPermission)) { segment.category = "chooseACategory" as Category; segment.actionType = ActionType.Skip; segment.description = ""; |