diff --git a/packages/core/src/builtins/torbox-search/debrid-service.ts b/packages/core/src/builtins/torbox-search/debrid-service.ts index 63df5ab6..e11a68ba 100644 --- a/packages/core/src/builtins/torbox-search/debrid-service.ts +++ b/packages/core/src/builtins/torbox-search/debrid-service.ts @@ -86,9 +86,9 @@ export class DebridService { let newResults: DebridFile[] = []; + const start = Date.now(); if (torrentsToCheck.length > 0) { try { - const start = Date.now(); const instantAvailability = await this.debridInterface.checkMagnets( torrentsToCheck.map((t) => t.hash), id @@ -148,9 +148,9 @@ export class DebridService { ); } } - logger.info( - `[${this.serviceConfig.id}] Checked ${torrentsToCheck.length} uncached magnets in ${getTimeTakenSincePoint(start)}` - ); + // logger.info( + // `[${this.serviceConfig.id}] Checked ${torrentsToCheck.length} uncached magnets in ${getTimeTakenSincePoint(start)}` + // ); } catch (error) { if (error instanceof StremThruError) { logger.error( @@ -181,6 +181,15 @@ export class DebridService { } } + // count number of cached results + const cachedCount = [...cachedResults, ...newResults].filter( + (result) => result.service.cached + ).length; + + logger.debug( + `[${this.serviceConfig.id}] Checked ${torrents.length} magnets in ${getTimeTakenSincePoint(start)}. ${cachedCount} / ${torrents.length} cached` + ); + return [...cachedResults, ...newResults]; } } diff --git a/packages/core/src/debrid/utils.ts b/packages/core/src/debrid/utils.ts index cd7c8619..ebcaa329 100644 --- a/packages/core/src/debrid/utils.ts +++ b/packages/core/src/debrid/utils.ts @@ -58,9 +58,6 @@ export function findMatchingFileInTorrent( (title) => file.parsed.title?.toLowerCase() === title.toLowerCase() ) ) { - console.log( - `Choosing file based on requested title match: ${file.name}` - ); chosenFile = file; break; } @@ -77,9 +74,6 @@ export function findMatchingFileInTorrent( (file) => file.name.toLowerCase() === requestedFilename.toLowerCase() ); if (requestedFile) { - console.log( - `Choosing file based on requested filename match: ${requestedFile.name}` - ); return requestedFile; } }