feat: add exclude season packs option

This commit is contained in:
Viren070
2025-10-18 22:47:13 +01:00
parent f8847bfd19
commit 4c7b28d744
3 changed files with 33 additions and 0 deletions
+1
View File
@@ -356,6 +356,7 @@ export const UserDataSchema = z.object({
.tuple([z.number().min(0), z.number().min(0)])
.optional(),
seederRangeTypes: z.array(z.enum(['p2p', 'cached', 'uncached'])).optional(),
excludeSeasonPacks: z.boolean().optional(),
excludeCached: z.boolean().optional(),
excludeCachedFromAddons: z.array(z.string().min(1)).optional(),
excludeCachedFromServices: z.array(z.string().min(1)).optional(),
+14
View File
@@ -32,6 +32,7 @@ export interface FilterStatistics {
titleMatching: Reason;
yearMatching: Reason;
seasonEpisodeMatching: Reason;
excludeSeasonPacks: Reason;
excludedStreamType: Reason;
requiredStreamType: Reason;
excludedResolution: Reason;
@@ -89,6 +90,7 @@ class StreamFilterer {
titleMatching: { total: 0, details: {} },
yearMatching: { total: 0, details: {} },
seasonEpisodeMatching: { total: 0, details: {} },
excludeSeasonPacks: { total: 0, details: {} },
excludedStreamType: { total: 0, details: {} },
requiredStreamType: { total: 0, details: {} },
excludedResolution: { total: 0, details: {} },
@@ -1168,6 +1170,18 @@ class StreamFilterer {
return false;
}
if (
this.userData.excludeSeasonPacks &&
stream.parsedFile?.season &&
!stream.parsedFile?.episode
) {
this.incrementRemovalReason(
'excludeSeasonPacks',
`${stream.parsedFile.title} - ${stream.parsedFile.season}`
);
return false;
}
if (
excludedRegexPatterns &&
(await testRegexes(stream, excludedRegexPatterns))
@@ -362,6 +362,24 @@ function Content() {
/>
</SettingsCard>
)}
{mode === 'pro' && (
<SettingsCard
title="Exclude Season Packs"
description="Whether to filter out results that contain entire seasons."
>
<Switch
label="Enable"
side="right"
value={userData.excludeSeasonPacks}
onValueChange={(value) => {
setUserData((prev) => ({
...prev,
excludeSeasonPacks: value,
}));
}}
/>
</SettingsCard>
)}
{mode === 'pro' && (
<SettingsCard title="Hide Errors">
<Switch