Compare commits

..

2 Commits

Author SHA1 Message Date
pcnick 2ab2d06efb 測試 3 weeks ago
pcnick 9ab3421fa4 修正錯誤 3 weeks ago
  1. 11
      Animelibk.ps1

11
Animelibk.ps1

@ -12,6 +12,7 @@
#$Include = ".rmvb", ".mp4", ".mkv", ".avi" #$Include = ".rmvb", ".mp4", ".mkv", ".avi"
$SubExt = if ($Sub) { ".ssa", ".ass", ".srt" } $SubExt = if ($Sub) { ".ssa", ".ass", ".srt" }
$Include = $Include + $SubExt
Import-Module -Name ($PSScriptRoot + "\PathChar.psd1") Import-Module -Name ($PSScriptRoot + "\PathChar.psd1")
Import-Module -Name ($PSScriptRoot + "\NameRegex.psd1") Import-Module -Name ($PSScriptRoot + "\NameRegex.psd1")
@ -21,7 +22,7 @@ $TargetName = ""
#$DestinName = "真の仲間" #$DestinName = "真の仲間"
Write-Output $Path Write-Output $Path
#$Index = "L:\AnimeLib" #$Index = "L:\AnimeLib"
d
# scriptblock 減少重複 # scriptblock 減少重複
$RegexpSet = { $RegexpSet = {
# 全域化 # 全域化
@ -165,14 +166,14 @@ if ($Single) {
$List = @(Get-Item -Path $(Edit-PathChar $Path)) $List = @(Get-Item -Path $(Edit-PathChar $Path))
$BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj | ? {$_.NewName.Episode -notin $WorkData.Episode} $BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj | ? {$_.NewName.Episode -notin $WorkData.Episode}
#$BuildList | ? {$_.NewName.Episode -notin $WorkData.Episode} | Format-List #$BuildList | ? {$_.NewName.Episode -notin $WorkData.Episode} | Format-List
<# } elseif ($Sub) { # } elseif ($Sub) {
$List = @(Get-Item -Path $(Edit-PathChar $Path)) # $List = @(Get-Item -Path $(Edit-PathChar $Path))
$BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj | ? {$_.File.Extension -in @(".ass", ".ssa")} #> # $BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj | ? {$_.File.Extension -in @(".ass", ".ssa")}
} elseif ($testrun) { } elseif ($testrun) {
$List = @(Edit-PathChar $Path | Get-Item | ? { $_.GetType().Name -eq "FileInfo" }) + $List = @(Edit-PathChar $Path | Get-Item | ? { $_.GetType().Name -eq "FileInfo" }) +
@(Edit-PathChar $Path | Get-Item | ? { $_.GetType().Name -eq "DirectoryInfo" } | % { $_.GetFiles() }) @(Edit-PathChar $Path | Get-Item | ? { $_.GetType().Name -eq "DirectoryInfo" } | % { $_.GetFiles() })
$BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj $BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj
if ($Include -ne "") { $BuildList = $BuildList | ? {$_.File.Extension -in $Include, $SubExt} } if ($Include -ne "") { $BuildList = $BuildList | ? {$_.File.Extension -in $Include} }
if (-not($Force)) { $BuildList = $BuildList | ? {$_.NewName.Episode -notin $WorkData.Episode} } if (-not($Force)) { $BuildList = $BuildList | ? {$_.NewName.Episode -notin $WorkData.Episode} }
} else { } else {
exit 0; exit 0;

Loading…
Cancel
Save