Browse Source

修正 S00E 與部份錯誤,並輸出錯誤訊息

develop
pcnick 3 weeks ago
parent
commit
696cd5601f
  1. 14
      Animelibk.ps1

14
Animelibk.ps1

@ -159,7 +159,7 @@ function Get-StandName {
}
# 建立回傳資料物件,以方便後續資料處理。
$OutputData = "" | Select newName, Season, Episode, newFullName;
$OutputData = "" | Select-Object newName, Season, Episode, newFullName;
$OutputData.newName = if ($LS) { $WorkData.Latinization } else { $Result.Name.Trim() }
$OutputData.Season = $WorkData.Season;
$OutputData.Episode = [int] $Result.Episode;
@ -192,7 +192,7 @@ $StructPathObj = @{
if ($Single) {
# 單集模式
$List = @(Get-Item -Path $(Edit-PathChar $Path))
$BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj | ? {$_.NewName.Episode -notin $WorkData.Episode}
$BuildList = $List | Select-Object $FileObj, $StructPathObj, $NewNameObj | ? {$_.NewName.Episode -notin $WorkData.Episode}
#$BuildList | ? {$_.NewName.Episode -notin $WorkData.Episode} | Format-List
# } elseif ($Sub) {
# $List = @(Get-Item -Path $(Edit-PathChar $Path))
@ -200,14 +200,15 @@ if ($Single) {
} elseif ($testrun) {
$List = @(Edit-PathChar $Path | Get-Item | ? { $_.GetType().Name -eq "FileInfo" }) +
@(Edit-PathChar $Path | Get-Item | ? { $_.GetType().Name -eq "DirectoryInfo" } | % { $_.GetFiles() })
$BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj
$BuildList = $List | Select-Object $FileObj, $StructPathObj, $NewNameObj
if ($Include -ne "") { $BuildList = $BuildList | ? {$_.File.Extension -in $Include} }
if (-not($Force)) { $BuildList = $BuildList | ? {$_.NewName.Episode -notin $WorkData.Episode} }
} else {
exit 0;
}
$ENDResult = $BuildList | % {
$ENDResult = $BuildList | ForEach-Object {
if ($_.NewName.Episode -and ($_.NewName.newName.Length -gt 0)) {
$Command = @{
ItemType = 'HardLink'
Path = $("{0}\{1}" -f $_.StructPath, $_.NewName.newFullName)
@ -219,7 +220,10 @@ $ENDResult = $BuildList | % {
$_.NewName }
#} catch {
#}
} else {
"{0} 處理錯誤" -f $_.File.FullName | Write-Error
$_.NewName
}
}
#$ENDResult
#$ENDResult.gettype();

Loading…
Cancel
Save