From 7aca0be41c447fd6bf97c3deda6fec1bd166b25c Mon Sep 17 00:00:00 2001 From: dr-carrot Date: Sat, 27 Jan 2024 18:34:55 -0500 Subject: [PATCH] chore: more log cleanup --- server/entity/MediaRequest.ts | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/server/entity/MediaRequest.ts b/server/entity/MediaRequest.ts index 947b63628..bd78ce80d 100644 --- a/server/entity/MediaRequest.ts +++ b/server/entity/MediaRequest.ts @@ -1108,14 +1108,6 @@ export class MediaRequest { sonarr .addSeries(sonarrSeriesOptions) .then(async (sonarrSeries) => { - // const reqCheck1 = await getRepository(MediaRequest).find({ - // where: { media: { id: this.media.id } }, - // }); - // logger.debug( - // `Before running the find the DB claims we have ${ - // reqCheck1?.length ?? 0 - // } relations` - // ); // We grab media again here to make sure we have the latest version of it const media = await mediaRepository.findOne({ where: { id: this.media.id }, @@ -1123,18 +1115,6 @@ export class MediaRequest { loadEagerRelations: true, }); - // logger.debug( - // `Typeorm claims ${ - // media?.requests?.length ?? 0 - // } relations are loaded` - // ); - // const reqCheck = await getRepository(MediaRequest).find({ - // where: { media: { id: this.media.id } }, - // }); - // logger.debug( - // `The DB claims we have ${reqCheck?.length ?? 0} relations` - // ); - if (!media) { throw new Error('Media data not found'); } @@ -1142,7 +1122,9 @@ export class MediaRequest { if (isPgsql) { // Force lazy loading of requests logger.debug('Forcing lazy loading of requests'); - media.requests; + media.requests.forEach((r) => + logger.debug(`loaded request ${r.id} with status ${r.status}`) + ); } media[this.is4k ? 'externalServiceId4k' : 'externalServiceId'] = @@ -1152,14 +1134,6 @@ export class MediaRequest { media[this.is4k ? 'serviceId4k' : 'serviceId'] = sonarrSettings?.id; await mediaRepository.save(media); - const reqCheck3 = await getRepository(MediaRequest).find({ - where: { media: { id: this.media.id } }, - }); - logger.debug( - `After save, the DB claims we have ${ - reqCheck3?.length ?? 0 - } relations` - ); logger.debug('Dumping media after save:'); logger.debug(JSON.stringify(media)); })