mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
feat(builtins/knaben): add blacklisted categories and filter search results accordingly
This commit is contained in:
@@ -22,6 +22,12 @@ export const KnabenAddonConfigSchema = BaseDebridConfigSchema;
|
||||
|
||||
export type KnabenAddonConfig = z.infer<typeof KnabenAddonConfigSchema>;
|
||||
|
||||
const BLACKLISTED_CATEGORIES = [
|
||||
KnabenCategory.AnimeLiterature,
|
||||
KnabenCategory.AnimeMusic,
|
||||
KnabenCategory.AnimeMusicVideo,
|
||||
];
|
||||
|
||||
export class KnabenAddon extends BaseDebridAddon<KnabenAddonConfig> {
|
||||
readonly id = 'knaben';
|
||||
readonly name = 'Knaben';
|
||||
@@ -100,7 +106,14 @@ export class KnabenAddon extends BaseDebridAddon<KnabenAddonConfig> {
|
||||
});
|
||||
|
||||
const allResults = await Promise.all(searchPromises);
|
||||
const hits = allResults.flat();
|
||||
const hits = allResults
|
||||
.flat()
|
||||
.filter(
|
||||
(hit) =>
|
||||
!BLACKLISTED_CATEGORIES.some((category) =>
|
||||
hit.categoryId.includes(category)
|
||||
)
|
||||
);
|
||||
|
||||
const seenTorrents = new Set<string>();
|
||||
const torrents: UnprocessedTorrent[] = [];
|
||||
|
||||
@@ -11,6 +11,14 @@ enum KnabenCategory {
|
||||
TV = 2000000,
|
||||
Movies = 3000000,
|
||||
Anime = 6000000,
|
||||
AnimeSubbed = 6001000,
|
||||
AnimeDubbed = 6002000,
|
||||
AnimeDualAudio = 6003000,
|
||||
AnimeRaw = 6004000,
|
||||
AnimeMusicVideo = 6005000,
|
||||
AnimeLiterature = 6006000,
|
||||
AnimeMusic = 6007000,
|
||||
AnimeNonEnglishTranslated = 6008000,
|
||||
}
|
||||
|
||||
const KnabenSearchHitSchema = z.looseObject({
|
||||
|
||||
Reference in New Issue
Block a user