diff --git a/src/Javinizer/Private/Convert-HTMLCharacter.ps1 b/src/Javinizer/Private/Convert-HTMLCharacter.ps1 index 93533f9e..293c098b 100644 --- a/src/Javinizer/Private/Convert-HTMLCharacter.ps1 +++ b/src/Javinizer/Private/Convert-HTMLCharacter.ps1 @@ -19,7 +19,7 @@ function Convert-HTMLCharacter { -replace ''', '' $newString = $String.Trim() - # Write-JLog -Level Debug -Message "Begin String: [$String]; End string: [$newString]" + # Write-JVLog -Level Debug -Message "Begin String: [$String]; End string: [$newString]" Write-Output $newString } } diff --git a/src/Javinizer/Private/Convert-JVTitle.ps1 b/src/Javinizer/Private/Convert-JVTitle.ps1 index 61252a7a..295515d3 100644 --- a/src/Javinizer/Private/Convert-JVTitle.ps1 +++ b/src/Javinizer/Private/Convert-JVTitle.ps1 @@ -86,7 +86,7 @@ function Convert-JVTitle { $id = ($file | Select-String $RegexString).Matches.Groups[$RegexIdMatch].Value $partNum = ($file | Select-String $RegexString).Matches.Groups[$RegexPtMatch].Value } catch { - Write-JLog -Level Debug -Message "File [$file] not matched by regex" + Write-JVLog -Level Debug -Message "File [$file] not matched by regex" break } if ($fileBaseNameUpper -eq 1) { @@ -198,7 +198,7 @@ function Convert-JVTitle { <# #Match ID-###-A, ID-###-B, etc. elseif ($fileBaseNameUpper[$x] -match "[-][0-9]{1,6}[-][a-iA-I]$") { - Write-JLog -Level Debug -Message "Match 3" + Write-JVLog -Level Debug -Message "Match 3" $fileP1, $fileP2, $fileP3, $fileP4 = $fileBaseNameUpper[$x] -split "([-][0-9]{1,6})[-]([a-zA-Z])" $fileBaseNameUpperCleaned += $fileP1 + $fileP2 + $fileP3 } diff --git a/src/Javinizer/Private/Get-JVUrlLocation.ps1 b/src/Javinizer/Private/Get-JVUrlLocation.ps1 index 863d343a..7e848640 100644 --- a/src/Javinizer/Private/Get-JVUrlLocation.ps1 +++ b/src/Javinizer/Private/Get-JVUrlLocation.ps1 @@ -70,7 +70,7 @@ function Get-JVUrlLocation { Source = 'jav321' } } else { - Write-JLog -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] [Url - $Url] not matched" + Write-JVLog -Level Warning -Message "[$($MyInvocation.MyCommand.Name)] [Url - $Url] not matched" } } Write-Output $testUrlObject diff --git a/src/Javinizer/Private/Write-JLog.ps1 b/src/Javinizer/Private/Write-JVLog.ps1 similarity index 94% rename from src/Javinizer/Private/Write-JLog.ps1 rename to src/Javinizer/Private/Write-JVLog.ps1 index 8a1273f6..7cd1cf92 100644 --- a/src/Javinizer/Private/Write-JLog.ps1 +++ b/src/Javinizer/Private/Write-JVLog.ps1 @@ -1,4 +1,4 @@ -function Write-JLog { +function Write-JVLog { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] diff --git a/src/Javinizer/Public/Get-DmmData.ps1 b/src/Javinizer/Public/Get-DmmData.ps1 index f37ee5a0..85f1f63e 100644 --- a/src/Javinizer/Public/Get-DmmData.ps1 +++ b/src/Javinizer/Public/Get-DmmData.ps1 @@ -10,10 +10,10 @@ function Get-DmmData { $dmmUrl = $Url try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$dmmUrl]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$dmmUrl]" $webRequest = Invoke-WebRequest -Uri $dmmUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$dmmUrl]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$dmmUrl]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -38,7 +38,7 @@ function Get-DmmData { #TrailerUrl = Get-DmmTrailerUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "DMM data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "DMM data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-DmmUrl.ps1 b/src/Javinizer/Public/Get-DmmUrl.ps1 index f33ecb0b..c6afbb90 100644 --- a/src/Javinizer/Public/Get-DmmUrl.ps1 +++ b/src/Javinizer/Public/Get-DmmUrl.ps1 @@ -12,7 +12,7 @@ function Get-DmmUrl { if ($r18Url) { $r18Id = (($r18Url -split 'id=')[1] -split '\/')[0] $directUrl = "https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=$r18Id" - Write-JLog -Level Debug -Message "Converting R18 Id to Dmm: [$r18Id] -> [$directUrl]" + Write-JVLog -Level Debug -Message "Converting R18 Id to Dmm: [$r18Id] -> [$directUrl]" } else { # Convert the movie Id (ID-###) to content Id (ID00###) to match dmm naming standards if ($Id -match '([a-zA-Z|tT28|rR18]+-\d+z{0,1}Z{0,1}e{0,1}E{0,1})') { @@ -23,10 +23,10 @@ function Get-DmmUrl { $searchUrl = "https://www.dmm.co.jp/search/?redirect=1&enc=UTF-8&category=&searchstr=$Id" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$searchUrl]" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$searchUrl]" } $retryCount = 3 @@ -38,19 +38,19 @@ function Get-DmmUrl { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$retryCount] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$retryCount] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" } $resultId = Get-DmmContentId -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" if ($resultId -match $Id) { $directUrl = $result break @@ -66,7 +66,7 @@ function Get-DmmUrl { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on DMM" + Write-JVLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on DMM" return } else { $urlObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-JVAggregatedData.ps1 b/src/Javinizer/Public/Get-JVAggregatedData.ps1 index a04915f5..6fb53ced 100644 --- a/src/Javinizer/Public/Get-JVAggregatedData.ps1 +++ b/src/Javinizer/Public/Get-JVAggregatedData.ps1 @@ -177,7 +177,7 @@ function Get-JVAggregatedData { } else { $aggregatedDataObject.$field = $sourceData.$field } - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [$field - $priority] Set to [$($sourceData.$field | ConvertTo-Json -Compress)]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [$field - $priority] Set to [$($sourceData.$field | ConvertTo-Json -Compress)]" } } } @@ -219,7 +219,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].LastName = $actressCsv[$matched[0].Index].LastName } - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [Alias - $aliasString] replaced by [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [Alias - $aliasString] replaced by [$actressString]" } } @@ -236,7 +236,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].ThumbUrl = $matchedActress.ThumbUrl $aggregatedDataObject.Actress[$x].JapaneseName = $matchedActress.JapaneseName $actressString = "$($aggregatedDataObject.Actress[$x].LastName) $($aggregatedDataObject.Actress[$x].FirstName)".Trim() - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" } # Check if JapaneseName matches the thumb csv } elseif ($matched = Compare-Object -ReferenceObject $actressCsv -DifferenceObject $aggregatedDataObject.Actress[$x] -IncludeEqual -ExcludeDifferent -PassThru -Property @('JapaneseName')) { @@ -252,7 +252,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].LastName = $matchedActress.LastName $aggregatedDataObject.Actress[$x].ThumbUrl = $matchedActress.ThumbUrl $actressString = "$($aggregatedDataObject.Actress[$x].JapaneseName)".Trim() - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" } # Check if FirstName matches the thumb csv for single-word names } elseif ($null -eq $aggregatedDataObject.Actress[$x].LastName -and $null -ne $aggregatedDataObject.Actress[$x].FirstName) { @@ -269,12 +269,12 @@ function Get-JVAggregatedData { $aggregatedDataObject.Actress[$x].ThumbUrl = $matchedActress.ThumbUrl $aggregatedDataObject.Actress[$x].JapaneseName = $matchedActress.JapaneseName $actressString = "$($aggregatedDataObject.Actress[$x].FirstName)".Trim() - Write-JLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" + Write-JVLog -Level Debug -Message "[$($Data[0].Id)] [$($MyInvocation.MyCommand.Name)] [ThumbUrl - $($matchedActress.ThumbUrl)] added to actress [$actressString]" } } } } else { - Write-JLog -Level Warning -Message "[$($Data[0].Id)] Thumbnail csv file is missing or cannot be found at path [$thumbCsvPath]" + Write-JVLog -Level Warning -Message "[$($Data[0].Id)] Thumbnail csv file is missing or cannot be found at path [$thumbCsvPath]" } } @@ -292,7 +292,7 @@ function Get-JVAggregatedData { $aggregatedDataObject.Description = $translatedDescription } } else { - Write-JLog -Level Warning -Message "[$($Data[0].Id)] Translation language is missing" + Write-JVLog -Level Warning -Message "[$($Data[0].Id)] Translation language is missing" } } diff --git a/src/Javinizer/Public/Get-JVData.ps1 b/src/Javinizer/Public/Get-JVData.ps1 index ef1e554c..7a800175 100644 --- a/src/Javinizer/Public/Get-JVData.ps1 +++ b/src/Javinizer/Public/Get-JVData.ps1 @@ -70,7 +70,7 @@ function Get-JVData { $jvModulePath = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'Javinizer.psm1' if ($R18) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18" Start-ThreadJob -Name "$Id-R18" -ScriptBlock { Import-Module $using:jvModulePath Get-R18Url -Id $using:Id -Language en | Get-R18Data @@ -78,7 +78,7 @@ function Get-JVData { } if ($R18Zh) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18Zh" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18Zh" Start-ThreadJob -Name "$Id-R18Zh" -ScriptBlock { Import-Module $using:jvModulePath Get-R18Url -Id $using:Id -Language zh | Get-R18Data @@ -86,7 +86,7 @@ function Get-JVData { } if ($Javlibrary) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javlibrary" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javlibrary" Start-ThreadJob -Name "$Id-Javlibrary" -ScriptBlock { Import-Module $using:jvModulePath Get-JavlibraryUrl -Id $using:Id -Language en | Get-JavlibraryData @@ -94,7 +94,7 @@ function Get-JVData { } if ($JavlibraryJa) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryJa" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryJa" Start-ThreadJob -Name "$Id-JavlibraryJa" -ScriptBlock { Import-Module $using:jvModulePath Get-JavlibraryUrl -Id $using:Id -Language ja | Get-JavlibraryData @@ -102,7 +102,7 @@ function Get-JVData { } if ($JavlibraryZh) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryZh" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryZh" Start-ThreadJob -Name "$Id-JavlibraryZh" -ScriptBlock { Import-Module $using:jvModulePath Get-JavlibraryUrl -Id $using:Id -Language zh | Get-JavlibraryData @@ -110,7 +110,7 @@ function Get-JVData { } if ($Dmm) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Dmm" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Dmm" Start-ThreadJob -Name "$Id-Dmm" -ScriptBlock { Import-Module $using:jvModulePath Get-DmmUrl -Id $using:Id | Get-DmmData @@ -118,7 +118,7 @@ function Get-JVData { } if ($Javbus) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javbus" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javbus" Start-ThreadJob -Name "$Id-Javbus" -ScriptBlock { Import-Module $using:jvModulePath Get-JavbusUrl -Id $using:Id -Language en | Get-JavbusData @@ -126,7 +126,7 @@ function Get-JVData { } if ($JavbusJa) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusJa" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusJa" Start-ThreadJob -Name "$Id-JavbusJa" -ScriptBlock { Import-Module $using:jvModulePath Get-JavbusUrl -Id $using:Id -Language ja | Get-JavbusData @@ -134,7 +134,7 @@ function Get-JVData { } if ($JavbusZh) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusZh" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusZh" Start-ThreadJob -Name "$Id-JavbusZh" -ScriptBlock { Import-Module $using:jvModulePath Get-JavbusUrl -Id $using:Id -Language zh | Get-JavbusData @@ -142,7 +142,7 @@ function Get-JVData { } if ($Jav321) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Jav321" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Jav321" Start-ThreadJob -Name "$Id-Jav321" -ScriptBlock { Import-Module $using:jvModulePath Get-Jav321Url -Id $using:Id | Get-Jav321Data @@ -158,7 +158,7 @@ function Get-JVData { $javinizerDataObject = Get-Job -Id $jobId | Receive-Job $hasData = ($javinizerDataObject | Select-Object Source).Source - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Data successfully retrieved from sources [$hasData]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Data successfully retrieved from sources [$hasData]" $dataObject = [PSCustomObject]@{ Data = $javinizerDataObject @@ -167,11 +167,11 @@ function Get-JVData { Write-Output $dataObject } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured during scraper jobs: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured during scraper jobs: $PSItem" } finally { # Remove all completed or running jobs before exiting this script # If jobs remain after closure, it may cause issues in concurrent runs - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Stopping/removing all completed/running jobs" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Stopping/removing all completed/running jobs" Get-Job | Remove-Job -Force } } diff --git a/src/Javinizer/Public/Get-Jav321Data.ps1 b/src/Javinizer/Public/Get-Jav321Data.ps1 index 8fd0ccd3..891e99c3 100644 --- a/src/Javinizer/Public/Get-Jav321Data.ps1 +++ b/src/Javinizer/Public/Get-Jav321Data.ps1 @@ -9,10 +9,10 @@ function Get-Jav321Data { $movieDataObject = @() try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url]" $webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -31,7 +31,7 @@ function Get-Jav321Data { ScreenshotUrl = Get-Jav321ScreenshotUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "Jav321 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "Jav321 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-Jav321Url.ps1 b/src/Javinizer/Public/Get-Jav321Url.ps1 index 448b8fbd..7b7288a0 100644 --- a/src/Javinizer/Public/Get-Jav321Url.ps1 +++ b/src/Javinizer/Public/Get-Jav321Url.ps1 @@ -9,10 +9,10 @@ function Get-Jav321Url { $searchUrl = "https://jp.jav321.com/search" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Post -Body "sn=$Id" -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" } @@ -30,16 +30,16 @@ function Get-Jav321Url { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { $result = "https://jp.jav321.com/video/$result" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-RestMethod -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" } $resultId = Get-Jav321Id -WebRequest $webRequest @@ -48,7 +48,7 @@ function Get-Jav321Url { break } - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" if ($count -eq $Tries) { break } @@ -57,7 +57,7 @@ function Get-Jav321Url { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" + Write-JVLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" return } else { $urlObject = [PSCustomObject]@{ @@ -67,7 +67,7 @@ function Get-Jav321Url { Write-Output $urlObject } } else { - Write-JLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" + Write-JVLog -Level Warning -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Search [$Id] not matched on Jav321" return } } diff --git a/src/Javinizer/Public/Get-JavbusData.ps1 b/src/Javinizer/Public/Get-JavbusData.ps1 index ac27413f..f424d9f6 100644 --- a/src/Javinizer/Public/Get-JavbusData.ps1 +++ b/src/Javinizer/Public/Get-JavbusData.ps1 @@ -9,10 +9,10 @@ function Get-JavbusData { $movieDataObject = @() try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url]" $webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -34,7 +34,7 @@ function Get-JavbusData { ScreenshotUrl = Get-JavbusScreenshotUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "JavBus data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "JavBus data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-JavbusUrl.ps1 b/src/Javinizer/Public/Get-JavbusUrl.ps1 index eee36c99..3b52df1d 100644 --- a/src/Javinizer/Public/Get-JavbusUrl.ps1 +++ b/src/Javinizer/Public/Get-JavbusUrl.ps1 @@ -13,20 +13,20 @@ function Get-JavbusUrl { $searchUrl = "https://www.javbus.com/search/$Id&type=0&parent=uc" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-RestMethod -Uri $searchUrl -Method Get -Verbose:$false } catch { try { $searchUrl = "https://www.javbus.com/uncensored/search/$Id&type=0&parent=uc" - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-RestMethod -Uri $searchUrl -Method Get -Verbose:$false } catch { try { $searchUrl = "https://www.javbus.org/search/$Id&type=0&parent=uc" - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-RestMethod -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Warning -Message "[$Id] not matched on JavBus" + Write-JVLog -Level Warning -Message "[$Id] not matched on JavBus" return } } @@ -46,15 +46,15 @@ function Get-JavbusUrl { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching [$Tries] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-RestMethod -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occurred on [GET] on URL [$result]: $PSItem" } $resultId = Get-JavbusId -WebRequest $webRequest if ($resultId -eq $Id) { @@ -66,7 +66,7 @@ function Get-JavbusUrl { break } - Write-JLog -Level Debug -Message "Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "Result [$count] is [$resultId]" if ($count -eq $Tries) { break @@ -76,7 +76,7 @@ function Get-JavbusUrl { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] not matched on JavBus" + Write-JVLog -Level Warning -Message "[$Id] not matched on JavBus" return } else { $urlObject = [PSCustomObject]@{ diff --git a/src/Javinizer/Public/Get-JavlibraryData.ps1 b/src/Javinizer/Public/Get-JavlibraryData.ps1 index 51eb3101..ede4f09b 100644 --- a/src/Javinizer/Public/Get-JavlibraryData.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryData.ps1 @@ -9,10 +9,10 @@ function Get-JavlibraryData { $movieDataObject = @() try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -34,7 +34,7 @@ function Get-JavlibraryData { ScreenshotUrl = Get-JavlibraryScreenshotUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "JAVLibrary data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "JAVLibrary data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 index 4ef34fa3..43c64da5 100644 --- a/src/Javinizer/Public/Get-JavlibraryUrl.ps1 +++ b/src/Javinizer/Public/Get-JavlibraryUrl.ps1 @@ -13,10 +13,10 @@ function Get-JavlibraryUrl { $searchUrl = "http://www.javlibrary.com/en/vl_searchbyid.php?keyword=$Id" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" } # Check if the search uniquely matched a video page @@ -24,14 +24,14 @@ function Get-JavlibraryUrl { $searchResultUrl = $webRequest.BaseResponse.RequestMessage.RequestUri.AbsoluteUri if ($searchResultUrl -match 'http:\/\/www\.javlibrary\.com\/en\/\?v=') { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $searchResultUrl -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchResultUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" } $resultId = Get-JavlibraryId -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" if ($resultId -eq $Id) { $javlibraryUrl = $searchResultUrl } @@ -53,14 +53,14 @@ function Get-JavlibraryUrl { $directUrl = "http://www.javlibrary.com/en/?v=$videoId" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]" $webRequest = Invoke-WebRequest -Uri $directUrl -Method Get -WebSession $Session -UserAgent $Session.UserAgent -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$directUrl] with Session: [$Session] and UserAgent: [$($Session.UserAgent)]: $PSItem" } $resultId = Get-JavlibraryId -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result [$count] is [$resultId]" if ($resultId -eq $Id) { $javlibraryUrl = (Get-JVUrlLocation -Url $webRequest.BaseResponse.RequestMessage.RequestUri.AbsoluteUri).Url @@ -77,7 +77,7 @@ function Get-JavlibraryUrl { } if ($null -eq $javlibraryUrl) { - Write-JLog -Level Warning -Message "[$Id] not matched on JavLibrary" + Write-JVLog -Level Warning -Message "[$Id] not matched on JavLibrary" return } else { if ($Language -eq 'ja') { diff --git a/src/Javinizer/Public/Get-R18Data.ps1 b/src/Javinizer/Public/Get-R18Data.ps1 index 29834aad..7eee29d0 100644 --- a/src/Javinizer/Public/Get-R18Data.ps1 +++ b/src/Javinizer/Public/Get-R18Data.ps1 @@ -57,10 +57,10 @@ function Get-R18Data { } try { - Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]" + Write-JVLog -Level Debug -Message "Performing [GET] on URL [$Url]" $webRequest = Invoke-WebRequest -Uri $Url -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" + Write-JVLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem" } $movieDataObject = [PSCustomObject]@{ @@ -85,7 +85,7 @@ function Get-R18Data { TrailerUrl = Get-R18TrailerUrl -WebRequest $webRequest } - Write-JLog -Level Debug -Message "R18 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" + Write-JVLog -Level Debug -Message "R18 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)" Write-Output $movieDataObject } } diff --git a/src/Javinizer/Public/Get-R18Url.ps1 b/src/Javinizer/Public/Get-R18Url.ps1 index 8f13907b..f3165282 100644 --- a/src/Javinizer/Public/Get-R18Url.ps1 +++ b/src/Javinizer/Public/Get-R18Url.ps1 @@ -16,7 +16,7 @@ function Get-R18Url { # If contentId is given, convert it back to standard movie ID to validate if ($Id -match '(?:\d{1,5})?([a-zA-Z]{2,10}|[tT]28|[rR]18)(\d{1,5})') { - Write-JLog -Level Debug -Message "Content ID [$Id] detected" + Write-JVLog -Level Debug -Message "Content ID [$Id] detected" $splitId = $Id | Select-String -Pattern '([a-zA-Z|tT28|rR18]{1,10})(\d{1,5})' $studioName = $splitId.Matches.Groups[1].Value $rawStudioId = $splitId.Matches.Groups[2].Value @@ -34,10 +34,10 @@ function Get-R18Url { # Try matching the video with Video ID try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" } $retryCount = 3 @@ -49,19 +49,19 @@ function Get-R18Url { } if ($numResults -ge 1) { - Write-JLog -Level Debug -Message "Searching [$retryCount] of [$numResults] results for [$Id]" + Write-JVLog -Level Debug -Message "Searching [$retryCount] of [$numResults] results for [$Id]" $count = 1 foreach ($result in $searchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" } $resultId = Get-R18Id -WebRequest $webRequest - Write-JLog -Level Debug -Message "Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "Result [$count] is [$resultId]" if ($resultId -eq $Id) { $directUrl = $result break @@ -80,10 +80,10 @@ function Get-R18Url { $searchUrl = "https://www.r18.com/common/search/searchword=$contentId/" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$searchUrl]" $webRequest = Invoke-WebRequest -Uri $searchUrl -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$searchUrl]: $PSItem" } $retryCount = 5 @@ -97,14 +97,14 @@ function Get-R18Url { $count = 1 foreach ($result in $altSearchResults) { try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on URL [$result]" $webRequest = Invoke-WebRequest -Uri $result -Method Get -Verbose:$false } catch { - Write-JLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" + Write-JVLog -Level Error -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Error occured on [GET] on URL [$result]: $PSItem" } $resultId = Get-R18Id -WebRequest $webRequest - Write-JLog -Level Debug -Message "Result [$count] is [$resultId]" + Write-JVLog -Level Debug -Message "Result [$count] is [$resultId]" if ($resultId -eq $Id) { $directUrl = $result break @@ -123,7 +123,7 @@ function Get-R18Url { $testUrl = "https://www.r18.com/videos/vod/movies/detail/-/id=$contentId/" try { - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on Uri [$testUrl]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Performing [GET] on Uri [$testUrl]" $webRequest = Invoke-WebRequest -Uri $testUrl -Method Get -Verbose:$false } catch { $webRequest = $null @@ -131,7 +131,7 @@ function Get-R18Url { if ($null -ne $webRequest) { $resultId = Get-R18Id -WebRequest $webRequest - Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" + Write-JVLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Result is [$resultId]" if ($resultId -eq $Id) { $directUrl = $testUrl } @@ -139,7 +139,7 @@ function Get-R18Url { } if ($null -eq $directUrl) { - Write-JLog -Level Warning -Message "[$Id] not matched on R18" + Write-JVLog -Level Warning -Message "[$Id] not matched on R18" return } else { if ($Language -eq 'zh') { diff --git a/src/Javinizer/Public/Javinizer.ps1 b/src/Javinizer/Public/Javinizer.ps1 index ef32044f..d0a41739 100644 --- a/src/Javinizer/Public/Javinizer.ps1 +++ b/src/Javinizer/Public/Javinizer.ps1 @@ -358,7 +358,7 @@ function Javinizer { } } } catch { - Write-JLog -Level Error -Message $_ + Write-JVLog -Level Error -Message $_ } #> } @@ -474,7 +474,7 @@ function Javinizer { try { Invoke-Item -LiteralPath $logPath } catch { - Write-JLog -Level Error -Message "Error occurred when opening log file [$logPath]: $PSItem" + Write-JVLog -Level Error -Message "Error occurred when opening log file [$logPath]: $PSItem" } } } @@ -484,7 +484,7 @@ function Javinizer { try { Invoke-Item -Path $settingsPath } catch { - Write-JLog -Level Error -Message "Error occurred when opening settings file [$settingsPath]: $PSItem" + Write-JVLog -Level Error -Message "Error occurred when opening settings file [$settingsPath]: $PSItem" } } } @@ -496,7 +496,7 @@ function Javinizer { } try { - Write-JLog -Level Debug -Message "Getting owned movies on JAVLibrary" + Write-JVLog -Level Debug -Message "Getting owned movies on JAVLibrary" $request = Invoke-WebRequest -Uri "https://www.javlibrary.com/en/mv_owned_print.php" -Verbose:$false -Headers @{ "method" = "GET" "authority" = "www.javlibrary.com" @@ -517,14 +517,14 @@ function Javinizer { $javlibraryOwnedMovies = ($request.content -split '' | ForEach-Object { (($_ -split '<\/td>')[0] -split ' ')[0] }) $global:javlibraryOwnedMovies = $javlibraryOwnedMovies[2..($javlibraryOwnedMovies.Length - 1)] } catch { - Write-JLog -Level Error -Message "Error getting existing owned movies on JAVLibrary: $PSItem" + Write-JVLog -Level Error -Message "Error getting existing owned movies on JAVLibrary: $PSItem" return } if ($null -ne $global:javlibraryOwnedMovies) { if ($global:javlibraryOwnedMovies.Count -gt 1) { if ($javlibraryOwnedMovies[0].Length -le 1) { - Write-JLog -Level Error -Message "Error authenticating to JAVLibrary to set owned movies, check that your username and sessionCookie are valid" + Write-JVLog -Level Error -Message "Error authenticating to JAVLibrary to set owned movies, check that your username and sessionCookie are valid" } } } @@ -536,7 +536,7 @@ function Javinizer { $movieList = (Convert-JavTitle -Path $SetJavLibraryOwned -Recurse:$Recurse -Settings $Settings -Strict:$Strict).Id } } catch { - Write-JLog -Level Error -Message "Error getting movies from [$SetJavLibraryOwned]: $PSItem" + Write-JVLog -Level Error -Message "Error getting movies from [$SetJavLibraryOwned]: $PSItem" } # Validate which movies in the current path are unowned @@ -548,12 +548,12 @@ function Javinizer { } } - Write-JLog -Level Info -Message "[$($unowned.Count)] movies to add" + Write-JVLog -Level Info -Message "[$($unowned.Count)] movies to add" if ($unowned.Count -ge 1) { $index = 1 foreach ($movie in $unowned) { - Write-JLog -Level Info -Message "($index of $($unowned.Count)) Setting [$movie] as owned on JAVLibrary" + Write-JVLog -Level Info -Message "($index of $($unowned.Count)) Setting [$movie] as owned on JAVLibrary" $javlibObject = Get-JavlibraryData -Name $movie if ($null -ne $javlibObject) { $ajaxId = $javlibObject.AjaxId @@ -561,12 +561,12 @@ function Javinizer { Set-JavlibraryOwned -AjaxId $ajaxId -JavlibraryUrl $url -Settings $settings Start-Sleep -Seconds $Settings.JavLibrary.'request-interval-sec' } else { - Write-JLog -Level Warning -Message "Skipping [$movie] -- not matched on JAVLibrary" + Write-JVLog -Level Warning -Message "Skipping [$movie] -- not matched on JAVLibrary" } $index++ } } else { - Write-JLog -Level Warning -Message "Exiting -- no new movies detected in [$SetJavLibraryOwned]" + Write-JVLog -Level Warning -Message "Exiting -- no new movies detected in [$SetJavLibraryOwned]" } } @@ -585,7 +585,7 @@ function Javinizer { try { Invoke-Item -Path (Join-Path $ScriptRoot -ChildPath 'r18-thumbs.csv') } catch { - Write-JLog -Level Error -Message "Error opening thumb csv: $PSItem" + Write-JVLog -Level Error -Message "Error opening thumb csv: $PSItem" } } elseif ($PSBoundParameters.ContainsKey('UpdateThumbs')) { Get-R18ThumbCsv -ScriptRoot $ScriptRoot -NewPages $UpdateThumbs -Force:$Force @@ -602,7 +602,7 @@ function Javinizer { # This will check that the Path is valid if (!(Test-Path -LiteralPath $Path)) { - Write-JLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Path [$Path] is not a valid path" + Write-JVLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Path [$Path] is not a valid path" } # Default destination path to location.output in settings if not specified @@ -616,14 +616,14 @@ function Javinizer { # This will check that the DestinationPath is a valid directory if (Test-Path -LiteralPath $DestinationPath -PathType Leaf) { - Write-JLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] DestinationPath [$DestinationPath] is not a valid directory path" + Write-JVLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] DestinationPath [$DestinationPath] is not a valid directory path" } try { $javMovies = $Settings | Get-JVItem -Path $Path -Recurse:$Recurse -Strict:$Strict 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]" + Write-JVLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Exiting -- no movies detected in [$Path]" } $index = 1 diff --git a/src/Javinizer/Public/Set-JVMovie.ps1 b/src/Javinizer/Public/Set-JVMovie.ps1 index 83f516cf..0d828e1e 100644 --- a/src/Javinizer/Public/Set-JVMovie.ps1 +++ b/src/Javinizer/Public/Set-JVMovie.ps1 @@ -167,7 +167,7 @@ function Set-JVMovie { } } - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] The destination folderPath is [$folderPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] The destination folderPath is [$folderPath]" <# $pathLength = (Join-Path -Path $folderPath -ChildPath $fileName).Length if ($pathLength -gt $MaxPathLength) { @@ -180,10 +180,10 @@ function Set-JVMovie { try { if (!(Test-Path -LiteralPath $folderPath)) { New-Item -Path $folderPath -ItemType Directory -Force:$Force | Out-Null - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] New directory created at path [$folderPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] New directory created at path [$folderPath]" } } catch { - Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating destination folder path [$folderPath]: $PSItem" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating destination folder path [$folderPath]: $PSItem" } if ($CreateNfo) { @@ -191,9 +191,9 @@ function Set-JVMovie { $nfoPath = Join-Path -Path $folderPath -ChildPath "$nfoName.nfo" $nfoContents = $Data | Get-JVNfo -NameOrder $NameOrder -AddTag $AddTag $nfoContents | Out-File -LiteralPath $nfoPath -Force:$Force - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Nfo file created at path [$nfoPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Nfo file created at path [$nfoPath]" } catch { - Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating nfo file [$nfoPath]: $PSItem" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating nfo file [$nfoPath]: $PSItem" } } @@ -207,15 +207,15 @@ function Set-JVMovie { } elseif ((!(Test-Path -LiteralPath $thumbPath))) { $webClient.DownloadFile(($Data.CoverUrl).ToString(), $thumbPath) } - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Thumbnail image [$($Data.CoverUrl)] downloaded to path [$thumbPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Thumbnail image [$($Data.CoverUrl)] downloaded to path [$thumbPath]" } catch { - Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating thumbnail image file [$thumbPath]: $PSItem" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating thumbnail image file [$thumbPath]: $PSItem" } if ($DownloadPosterImg) { 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]" + Write-JVLog -Level Debug "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] crop.py path located at path [$cropScript]" $posterPath = Join-Path $folderPath -ChildPath "$posterName.jpg" $pythonThumbPath = $thumbPath -replace '\\', '/' $pythonPosterPath = $posterPath -replace '\\', '/' @@ -233,9 +233,9 @@ function Set-JVMovie { python3 $cropScript $pythonThumbPath $pythonPosterPath } } - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Poster image [$thumbPath] cropped to path [$posterPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Poster image [$thumbPath] cropped to path [$posterPath]" } catch { - Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating poster image file [$posterPath]: $PSItem" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating poster image file [$posterPath]: $PSItem" } } } @@ -261,11 +261,11 @@ function Set-JVMovie { } elseif (!(Test-Path -LiteralPath $actressThumbPath)) { $webClient.DownloadFile($actress.thumb, $actressThumbPath) } - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Actress image file [$($actress.thumb)] downloaded to path [$actressThumbPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Actress image file [$($actress.thumb)] downloaded to path [$actressThumbPath]" } } } catch { - Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating actress image files: $PSItem" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating actress image files: $PSItem" } } } @@ -288,10 +288,10 @@ function Set-JVMovie { $webClient.DownloadFile($screenshot, $screenshotPath) } $index++ - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Screenshot image file [$screenshot] downloaded to path [$screenshotPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Screenshot image file [$screenshot] downloaded to path [$screenshotPath]" } } catch { - Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating screenshot image files: $PSItem" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating screenshot image files: $PSItem" } } } @@ -305,9 +305,9 @@ function Set-JVMovie { } elseif (!(Test-Path -LiteralPath $trailerPath)) { $webClient.DownloadFile($Data.TrailerUrl, $trailerPath) } - Write-JLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Trailer video [$($Data.TrailerUrl)] downloaded to path [$trailerPath]" + Write-JVLog -Level Debug -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Trailer video [$($Data.TrailerUrl)] downloaded to path [$trailerPath]" } catch { - Write-JLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating trailer video file [$($Data.TrailerUrl)] to [$trailerName]: $PSItem" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when creating trailer video file [$($Data.TrailerUrl)] to [$trailerName]: $PSItem" } } } @@ -317,21 +317,21 @@ 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)] Completed [$Path] -> [$filePath]" + Write-JVLog -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" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when renaming and moving file [$Path] to [$filePath]: $PSItem" } } else { try { $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)] Completed [$Path] -> [$filePath]" + Write-JVLog -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" + Write-JVLog -Level Error -Message "[$($Data.Id)] [$($MyInvocation.MyCommand.Name)] Error occurred when renaming and moving file [$Path] to [$filePath]: $PSItem" } } } diff --git a/src/Javinizer/Public/Update-JVThumbs.ps1 b/src/Javinizer/Public/Update-JVThumbs.ps1 index 15794d42..5dc8d5a3 100644 --- a/src/Javinizer/Public/Update-JVThumbs.ps1 +++ b/src/Javinizer/Public/Update-JVThumbs.ps1 @@ -69,18 +69,18 @@ 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 "[Page $x] Actress [($actressString - $($actress.JapaneseName)] written to thumb csv" + Write-JVLog -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 "[Page $x] Actress [($actressString - $($actress.JapaneseName)] written to thumb csv" + Write-JVLog -Level Info -Message "[Page $x] Actress [($actressString - $($actress.JapaneseName)] written to thumb csv" $actress | Export-Csv -LiteralPath $Path -Append -Encoding utf8 } } } } catch { - Write-JLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occured when updating Javinizer thumb csv at path [$Path]: $PSItem" + Write-JVLog -Level Error -Message "[$($MyInvocation.MyCommand.Name)] Error occured when updating Javinizer thumb csv at path [$Path]: $PSItem" } } }