mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix: fetch metadata if year matching is enabled too and apply request types and addon
This commit is contained in:
@@ -93,7 +93,11 @@ class StreamFilterer {
|
||||
]);
|
||||
|
||||
let requestedMetadata: TMDBMetadataResponse | undefined;
|
||||
if (this.userData.titleMatching?.enabled && TYPES.includes(type as any)) {
|
||||
if (
|
||||
(this.userData.titleMatching?.enabled ||
|
||||
this.userData.yearMatching?.enabled) &&
|
||||
TYPES.includes(type as any)
|
||||
) {
|
||||
try {
|
||||
requestedMetadata = await new TMDBMetadata({
|
||||
accessToken: this.userData.tmdbAccessToken,
|
||||
@@ -173,6 +177,21 @@ class StreamFilterer {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
yearMatchingOptions.requestTypes?.length &&
|
||||
(!yearMatchingOptions.requestTypes.includes(type) ||
|
||||
(isAnime && !yearMatchingOptions.requestTypes.includes('anime')))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
yearMatchingOptions.addons?.length &&
|
||||
!yearMatchingOptions.addons.includes(stream.addon.preset.id)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const streamYear = stream.parsedFile?.year;
|
||||
if (!streamYear && type === 'movie') {
|
||||
// only filter out movies without a year as series results usually don't include a year
|
||||
|
||||
Reference in New Issue
Block a user