From 98c93bb5690d31ba20310906dcb42fd772e9be94 Mon Sep 17 00:00:00 2001 From: jvlflame Date: Mon, 31 Aug 2020 01:20:42 -0700 Subject: [PATCH] Update verbose messaging --- src/Javinizer/Public/Javinizer.ps1 | 2 +- src/Javinizer/Public/Set-JVMovie.ps1 | 10 ++-------- src/Javinizer/Public/Update-JVThumbs.ps1 | 4 ++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index de9b3f1d..f052f82c 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -581,7 +581,7 @@ function Javinizer { try { $javMovies = $Settings | Get-JVItem -Path $Path -Recurse:$Recurse -Strict:$Strict - Write-Host "[$($MyInvocation.MyCommand.Name)] [Path - $Path] [DestinationPath - $DestinationPath] [Count - $($javMovies.Count)]" + Write-Host "[$($MyInvocation.MyCommand.Name)] [Path - $Path] [DestinationPath - $DestinationPath] [Files - $($javMovies.Count)]" } catch { Write-JLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Exiting -- no movies detected in [$Path]" } diff --git a/src/Javinizer/Public/Set-JVMovie.ps1 b/src/Javinizer/Public/Set-JVMovie.ps1 index f94bf689..4c466c1e 100644 --- a/src/Javinizer/Public/Set-JVMovie.ps1 +++ b/src/Javinizer/Public/Set-JVMovie.ps1 @@ -165,7 +165,6 @@ function Set-JVMovie { } if ($CreateNfo) { - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Creating nfo file" try { $nfoPath = Join-Path -Path $folderPath -ChildPath "$nfoName.nfo" $nfoContents = $Data | Get-JVNfo -NameOrder $NameOrder -AddTag $AddTag @@ -178,7 +177,6 @@ function Set-JVMovie { if ($DownloadThumbImg) { if ($null -ne $Data.CoverUrl) { - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Creating thumbnail image" try { $webClient = New-Object System.Net.WebClient $thumbPath = Join-Path -Path $folderPath -ChildPath "$thumbName.jpg" @@ -193,7 +191,6 @@ function Set-JVMovie { } if ($DownloadPosterImg) { - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Creating poster image" try { $cropScript = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'crop.py' Write-JLog -Level Debug "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] crop.py path located at path [$cropScript]" @@ -224,7 +221,6 @@ function Set-JVMovie { if ($DownloadActressImg) { if ($null -ne $Data.Actress) { - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Creating actress images" try { $webClient = New-Object System.Net.WebClient $actorFolderPath = Join-Path -Path $folderPath -ChildPath $actorFolderName @@ -254,7 +250,6 @@ function Set-JVMovie { if ($DownloadScreenshotImg) { if ($null -ne $Data.ScreenshotUrl) { - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Creating screenshot images" try { $index = 1 $webClient = New-Object System.Net.WebClient @@ -281,7 +276,6 @@ function Set-JVMovie { if ($DownloadTrailerVid) { if ($null -ne $Data.TrailerUrl) { - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Creating trailer video" try { $trailerPath = Join-Path -Path $folderPath -ChildPath "$trailerName.mp4" if ($Force.IsPresent) { @@ -301,7 +295,7 @@ function Set-JVMovie { $filePath = Join-Path -Path $folderPath -ChildPath "$fileName$((Get-Item -LiteralPath $Path).Extension)" if ((Get-Item -LiteralPath $DestinationPath).Directory -ne (Get-Item -LiteralPath $Path).Directory) { Move-Item -LiteralPath $Path -Destination $filePath -Force:$Force - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Completed [$Path -> $filePath]" + Write-JLog -Level Info "[$($Data.Id)] Completed [$Path] -> [$filePath]" } } catch { Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when renaming and moving file [$Path] to [$filePath]: $PSItem" @@ -311,7 +305,7 @@ function Set-JVMovie { $filePath = Join-Path -Path $folderPath -ChildPath (Get-Item -LiteralPath $Path).Name if ((Get-Item -LiteralPath $DestinationPath).Directory -ne (Get-Item -LiteralPath $Path).Directory) { Move-Item -LiteralPath $Path -Destination $filePath -Force:$Force - Write-JLog -Level Info "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Completed [$Path -> $filePath]" + Write-JLog -Level Info "[$($Data.Id)] Completed [$Path] -> [$filePath]" } } catch { diff --git a/src/Javinizer/Public/Update-JVThumbs.ps1 b/src/Javinizer/Public/Update-JVThumbs.ps1 index c9700124..08cc09cf 100644 --- a/src/Javinizer/Public/Update-JVThumbs.ps1 +++ b/src/Javinizer/Public/Update-JVThumbs.ps1 @@ -67,12 +67,12 @@ function Update-JVThumbs { if ($null -ne $actressCsv) { if (!(Compare-Object -ReferenceObject $actressCsv -DifferenceObject $actress -IncludeEqual -ExcludeDifferent -Property @('JapaneseName', 'ThumbUrl'))) { $actressString = "$($actress.LastName) $($actress.FirstName)".Trim() - Write-JLog -Level Info -Message "[$($MyInvocation.MyCommand.Name)] [Page $x] Actress [($actressString - $($actress.JapaneseName)] written to [$Path]" + Write-JLog -Level Info -Message "[Page $x] Actress [($actressString - $($actress.JapaneseName)] written to thumb csv" $actress | Export-Csv -LiteralPath $Path -Append -Encoding utf8 } } else { $actressString = "$($actress.LastName) $($actress.FirstName)".Trim() - Write-JLog -Level Info -Message "[$($MyInvocation.MyCommand.Name)] [Page $x] Actress [($actressString - $($actress.JapaneseName)] written to [$Path]" + Write-JLog -Level Info -Message "[Page $x] Actress [($actressString - $($actress.JapaneseName)] written to thumb csv" $actress | Export-Csv -LiteralPath $Path -Append -Encoding utf8 } }