From b1b4dd9cfc08e1001900ea6b9dec6866f9fc9e02 Mon Sep 17 00:00:00 2001 From: dr-carrot Date: Sat, 27 Jan 2024 17:07:10 -0500 Subject: [PATCH] chore: added some debug sanity checks --- server/entity/MediaRequest.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/entity/MediaRequest.ts b/server/entity/MediaRequest.ts index 85537bd51..6e40e9d54 100644 --- a/server/entity/MediaRequest.ts +++ b/server/entity/MediaRequest.ts @@ -1114,6 +1114,18 @@ export class MediaRequest { relations: { requests: 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'); }