diff --git a/Animelibk.ps1 b/Animelibk.ps1 index 26e5fe8..b8cb455 100644 --- a/Animelibk.ps1 +++ b/Animelibk.ps1 @@ -68,7 +68,7 @@ $WorkData = $(if (Test-Path $RecorDB) { Get-Content $RecorDB | ConvertFrom-Json } else { "" -}) | Select-Object ID, WorkName, TargetName, DestinName, Season, Episode, Latinization, Standard +}) | Select-Object ID, WorkName, TargetName, DestinName, Latinization, Standard, Season, Episode $RecorDB # 確認資料狀態,缺少則進行物件資料建立 @@ -92,7 +92,7 @@ $Latinization = { param($String) # 載入置換檔 - $C = if (Test-path $PSScriptRoot\C2E.csv) {Import-Csv -Encoding UTF8 $PSScriptRoot\C2E.csv} + $C = if ($WorkData.Standard -and (Test-path $PSScriptRoot\C2E.csv)) {Import-Csv -Encoding UTF8 $PSScriptRoot\C2E.csv} if ($WorkData.Latinization.Length -eq 0) { $T = Read-Host "請輸入拉丁化作品名稱" @@ -105,7 +105,7 @@ $Latinization = { $RuleString = $RuleString + $Matches[0] $TString = $TString -replace $Matches[0], '-' } - return $String -replace $RuleString, $T + return ($String -replace "$RuleString\s?", "$T ").Trim() } } $WorkData