From ae7d402b8d02ed2a7058523bfc1d2fd000b735fa Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 27 Apr 2020 19:54:57 -0400 Subject: [PATCH] v4.1.2 (#66) *Fixed minor issue where failover threshold percentage was not being dynamically generated, leading to possibly incorrect reporting in console and logging. Closes #64 --- conv2mp4-ps.ps1 | 2 +- files/func/PrintEncodeError.ps1 | 4 ++-- files/prop/properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conv2mp4-ps.ps1 b/conv2mp4-ps.ps1 index af0205a..be28c7a 100644 --- a/conv2mp4-ps.ps1 +++ b/conv2mp4-ps.ps1 @@ -1,5 +1,5 @@ <#====================================================================================================================== -conv2mp4-ps v4.1.1 - https://github.com/BrianDMG/conv2mp4-ps +conv2mp4-ps v4.1.2 - https://github.com/BrianDMG/conv2mp4-ps This Powershell script will recursively search through a user-defined file path and convert all videos of user-specified include_file_types to MP4 with H264 video and AAC audio using ffmpeg. If a conversion failure is detected, the script re-encodes diff --git a/files/func/PrintEncodeError.ps1 b/files/func/PrintEncodeError.ps1 index 265a914..73e5eed 100644 --- a/files/func/PrintEncodeError.ps1 +++ b/files/func/PrintEncodeError.ps1 @@ -1,10 +1,10 @@ -# If new file is over 25% smaller than the original file, trigger encoding failure +# If file size delta exceeds failover threshold, trigger encoding failure Function PrintEncodeError { $fileSizeDelta = [Math]::Round($targetFileCompare.length - $sourceFileCompare.length)/1MB $fileSizeDelta = [Math]::Round($fileSizeDelta, 2) Try { Remove-Item -LiteralPath $targetFile -Force -ErrorAction Stop - Log "$($time.Invoke()) EXCEPTION: New file is over 25% smaller ($($fileSizeDelta)MB)." + Log "$($time.Invoke()) EXCEPTION: New file is over $($cfg.failover_threshold -replace '[.]','')% smaller ($($fileSizeDelta)MB)." Log "$($time.Invoke()) $targetFileRenamed deleted." Log "$($time.Invoke()) FAILOVER: Re-encoding $sourceFile with Handbrake." } diff --git a/files/prop/properties b/files/prop/properties index 019957b..9286e25 100644 --- a/files/prop/properties +++ b/files/prop/properties @@ -1,5 +1,5 @@ #Version -version=4.1.1 +version=4.1.2 platform=ps #URLs