chore: added some debug sanity checks

This commit is contained in:
dr-carrot
2024-01-27 17:07:10 -05:00
parent eb111ac1db
commit b1b4dd9cfc

View File

@@ -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');
}