mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
feat: add strict mode to season/episode matching
Release-As: 2.16.1
This commit is contained in:
@@ -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(),
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user