fix: filter out nzbs with failed status

This commit is contained in:
Viren070
2025-11-26 17:16:28 +00:00
parent d74c840a77
commit 174e813127
2 changed files with 9 additions and 2 deletions
@@ -426,6 +426,13 @@ async function processNZBsForDebridService(
const nzbCheckResult = nzbCheckResults.find(
(result) => result.hash === nzb.hash
);
if (nzbCheckResult?.status === 'failed') {
logger.debug(`Skipping NZB as its status is failed`, {
service: service.id,
nzb: nzb.title,
});
continue;
}
const parsedNzb = parsedTitlesMap.get(nzb.title ?? '');
if (metadata && parsedNzb) {
if (isSeasonWrong(parsedNzb, metadata)) {
@@ -619,7 +619,7 @@ export abstract class UsenetStreamService implements DebridService {
const history = await this.api.history();
const nzbs: DebridDownload[] = history.slots.map((slot, index) => ({
id: index,
status: 'cached' as const,
status: slot.status !== 'failed' ? 'cached' : 'failed',
name: slot.name,
}));
this.serviceLogger.debug(`Listed NZBs from history`, {
@@ -679,7 +679,7 @@ export abstract class UsenetStreamService implements DebridService {
);
return {
id: index,
status: 'cached',
status: libraryNzb?.status === 'failed' ? 'failed' : 'cached',
library: !!libraryNzb,
hash: h,
name: n,