Skip to content

Commit

Permalink
fix: Improved Overseerr rule logs in case of failures (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenn92 authored Jul 18, 2024
1 parent 074c7c3 commit f6466e3
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion server/src/modules/rules/getter/overseerr-getter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,23 @@ export class OverseerrGetterService {
? origLibItem.index
: origLibItem.parentIndex,
);
if (!seasonMediaResponse) {
this.logger.warn(
`Couldn't fetch season data for '${libItem.title}' season ${
dataType === EPlexDataType.SEASONS
? origLibItem.index
: origLibItem.parentIndex
} from Overseerr. As a result, unreliable results are expected.`,
);
}
}
}
} else {
this.logger.warn(
`Couldn't find tmdb id for media '${libItem.title}' with id '${libItem.ratingKey}'. As a result, no Overseerr query could be made.`,
);
}

if (mediaResponse && mediaResponse.mediaInfo) {
switch (prop.name) {
case 'addUser': {
Expand All @@ -99,7 +113,9 @@ export class OverseerrGetterService {
) {
const includesSeason = this.includesSeason(
request,
seasonMediaResponse.seasonNumber,
dataType === EPlexDataType.SEASONS
? origLibItem.index
: origLibItem.parentIndex,
);
if (includesSeason) {
userNames.push(
Expand Down Expand Up @@ -250,6 +266,9 @@ export class OverseerrGetterService {
}
}
} else {
this.logger.warn(
`Couldn't fetch Overseerr metadate for media '${libItem.title}' with id '${libItem.ratingKey}'. As a result, no Overseerr query could be made.`,
);
return null;
}
} catch (e) {
Expand Down

0 comments on commit f6466e3

Please sign in to comment.