From d76b3c8f78a4e1b3c141d4901110606d7da9298a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Sun, 9 Apr 2023 04:35:54 +0300 Subject: [PATCH] chore(server): remove unneeded debug logging (#2203) * chore(server): commented out debug log line for codecs * chore(server): removed debug log line for codecs as it's not needed * Prettier run * Make the log more useful and move it to verbose level --- server/libs/domain/src/media/media.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/libs/domain/src/media/media.service.ts b/server/libs/domain/src/media/media.service.ts index 764b1448d8..5af30ef9ad 100644 --- a/server/libs/domain/src/media/media.service.ts +++ b/server/libs/domain/src/media/media.service.ts @@ -1,4 +1,4 @@ -import { AssetType, TranscodePreset } from '@app/infra/entities'; +import { AssetEntity, AssetType, TranscodePreset } from '@app/infra/entities'; import { Inject, Injectable, Logger } from '@nestjs/common'; import { join } from 'path'; import { IAssetRepository, mapAsset, WithoutProperty } from '../asset'; @@ -137,7 +137,7 @@ export class MediaService { const { ffmpeg: config } = await this.configCore.getConfig(); - const required = this.isTranscodeRequired(mainVideoStream, mainAudioStream, containerExtension, config); + const required = this.isTranscodeRequired(asset, mainVideoStream, mainAudioStream, containerExtension, config); if (!required) { return; } @@ -164,6 +164,7 @@ export class MediaService { } private isTranscodeRequired( + asset: AssetEntity, videoStream: VideoStreamInfo, audioStream: AudioStreamInfo, containerExtension: string, @@ -178,7 +179,9 @@ export class MediaService { const isTargetAudioCodec = audioStream.codecName === ffmpegConfig.targetAudioCodec; const isTargetContainer = ['mov,mp4,m4a,3gp,3g2,mj2', 'mp4', 'mov'].includes(containerExtension); - this.logger.debug(audioStream.codecName, audioStream.codecType, containerExtension); + this.logger.verbose( + `${asset.id}: AudioCodecName ${audioStream.codecName}, AudioStreamCodecType ${audioStream.codecType}, containerExtension ${containerExtension}`, + ); const allTargetsMatching = isTargetVideoCodec && isTargetAudioCodec && isTargetContainer;