Skip to content

Commit

Permalink
Update verbose messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Aug 31, 2020
1 parent 2926972 commit 98c93bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Javinizer/Public/Javinizer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
}
Expand Down
10 changes: 2 additions & 8 deletions src/Javinizer/Public/Set-JVMovie.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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]"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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"
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/Javinizer/Public/Update-JVThumbs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 98c93bb

Please sign in to comment.