chore: more log cleanup

This commit is contained in:
dr-carrot
2024-01-27 18:34:55 -05:00
parent 0bab6887b0
commit 7aca0be41c

View File

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