mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
feat: add exclude season packs option
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user