feat: add strict mode to season/episode matching

Release-As: 2.16.1
This commit is contained in:
Viren070
2025-10-22 15:23:06 +01:00
parent 70a4d5345d
commit 703e284e0a
3 changed files with 29 additions and 0 deletions
+1
View File
@@ -462,6 +462,7 @@ export const UserDataSchema = z.object({
seasonEpisodeMatching: z
.object({
enabled: z.boolean().optional(),
strict: z.boolean().optional(),
requestTypes: z.array(z.string()).optional(),
addons: z.array(z.string()).optional(),
})
+10
View File
@@ -659,6 +659,16 @@ class StreamFilterer {
return false;
}
// if the requested content is series and no season or episode info is present, filter out if strict is true
if (
type === 'series' &&
seasonEpisodeMatchingOptions.strict &&
!stream.parsedFile?.season &&
!stream.parsedFile?.episode
) {
return false;
}
// is requested season present
if (
requestedSeason &&
@@ -1444,6 +1444,24 @@ function Content() {
}}
/>
<Switch
label="Strict"
side="right"
help="Filter out streams for series that don't have any season or episode specified."
moreHelp="Without this enabled, only streams with present but incorrect season or episode will be filtered out."
disabled={!userData.seasonEpisodeMatching?.enabled}
value={userData.seasonEpisodeMatching?.strict ?? false}
onValueChange={(value) => {
setUserData((prev) => ({
...prev,
seasonEpisodeMatching: {
...prev.seasonEpisodeMatching,
strict: value,
},
}));
}}
/>
<div className="space-y-4">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<Combobox