From 8004fdae64c2788a360c83bfe92b00f7456673ce Mon Sep 17 00:00:00 2001 From: jvlflame Date: Sun, 18 Oct 2020 14:41:56 -0700 Subject: [PATCH] Update IsWeb functionality (#129) --- src/Javinizer/Public/Javinizer.ps1 | 31 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index 9e0221c9..512b2dd0 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -833,7 +833,7 @@ function Javinizer { if (!($PSboundParameters.ContainsKey('IsThread'))) { $jvModulePath = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'Javinizer.psm1' if ($PSBoundParameters.ContainsKey('IsWeb')) { - $javMovies | Invoke-Parallel -MaxQueue $Settings.'throttlelimit' -Throttle $Settings.'throttlelimit' -Quiet:$HideProgress -ScriptBlock { + $javMovies | Invoke-Parallel -IsWeb -MaxQueue $Settings.'throttlelimit' -Throttle $Settings.'throttlelimit' -Quiet:$HideProgress -ScriptBlock { Import-Module $using:jvModulePath $jvMovie = $_ $Settings = $using:Settings @@ -857,26 +857,25 @@ function Javinizer { } $javData = Get-JVData -Id $movie.Id -Settings $Settings -UncensorCsvPath $uncensorCsvPath -Strict:$Strict -Session:$CfSession - if ($PSBoundParameters.ContainsKey('IsWeb')) { - $javAggregatedData = $javData | Get-JVAggregatedData -Settings $Settings -MediaInfo $mediaInfo - [PSCustomObject]@{ - Data = $javAggregatedData.Data - Path = $movie.FullName - PartNumber = $movie.PartNumber - } - } else { - if ($null -ne $javData) { - $javAggregatedData = $javData | Get-JVAggregatedData -Settings $Settings -MediaInfo $mediaInfo | Test-JVData -RequiredFields $Settings.'sort.metadata.requiredfield' - if ($javAggregatedData.NullFields -eq '') { - $javAggregatedData | Set-JVMovie -Path $movie.FullName -DestinationPath $DestinationPath -Settings $Settings -PartNumber $movie.Partnumber -Update:$Update -Force:$Force + if ($null -ne $javData) { + $javAggregatedData = $javData | Get-JVAggregatedData -Settings $Settings -MediaInfo $mediaInfo | Test-JVData -RequiredFields $Settings.'sort.metadata.requiredfield' + if ($javAggregatedData.NullFields -eq '') { + if ($PSBoundParameters.ContainsKey('IsWeb')) { + [PSCustomObject]@{ + Path = $movie.FullName + Data = $javAggregatedData.Data + PartNumber = $movie.PartNumber + } } else { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($movie.FileName)] Skipped -- missing required fields [$($javAggregatedData.NullFields)]" - return + $javAggregatedData | Set-JVMovie -Path $movie.FullName -DestinationPath $DestinationPath -Settings $Settings -PartNumber $movie.Partnumber -Update:$Update -Force:$Force } } else { - Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($movie.FileName)] Skipped -- not matched" + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($movie.FileName)] Skipped -- missing required fields [$($javAggregatedData.NullFields)]" return } + } else { + Write-JVLog -Write:$script:JVLogWrite -LogPath $script:JVLogPath -WriteLevel $script:JVLogWriteLevel -Level Warning -Message "[$($movie.FileName)] Skipped -- not matched" + return } } }