mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 14:07:13 +03:00
Fix video labels showing all categories regardless of settings
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Category, VideoID } from "../types";
|
||||
import { Category, CategorySkipOption, VideoID } from "../types";
|
||||
import { getHash } from "@ajayyy/maze-utils/lib/hash";
|
||||
import Utils from "../utils";
|
||||
import { logWarn } from "./logger";
|
||||
@@ -58,7 +58,12 @@ export async function getVideoLabel(videoID: VideoID): Promise<Category | null>
|
||||
const result = await getLabelHashBlock(prefix);
|
||||
|
||||
if (result) {
|
||||
return result.videos[videoID] ?? null;
|
||||
const category = result.videos[videoID];
|
||||
if (category && utils.getCategorySelection(category).option !== CategorySkipOption.Disabled) {
|
||||
return category;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user