Browse Source

運作模式新增視輸入檔案屬性進行連續處理

develop
pcnick 1 year ago
parent
commit
780e8d1d2f
  1. 12
      Animelibk.ps1

12
Animelibk.ps1

@ -3,9 +3,11 @@
$Index = "H:\AnimeLib",
$VarConfig,
$RecorDB = "animelibk.ini",
$Include = @(".rmvb", ".mp4", ".mkv", ".ass", ".ssa"),
[switch] $Single,
[switch] $Force,
[switch] $Sub
[switch] $Sub,
[switch] $testrun
)
Import-Module -Name ($PSScriptRoot + "\PathChar.psd1")
Import-Module -Name ($PSScriptRoot + "\NameRegex.psd1")
@ -150,6 +152,14 @@ if ($Single) {
} elseif ($Sub) {
$List = @(Get-Item -Path $(Edit-PathChar $Path))
$BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj | ? {$_.File.Extension -in @(".ass", ".ssa")}
} 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
if ($Include -ne "") { $BuildList = $BuildList | ? {$_.File.Extension -in $Include} }
if (-not($Force)) { $BuildList = $BuildList | ? {$_.NewName.Episode -notin $WorkData.Episode} }
} else {
exit 0;
}
$ENDResult = $BuildList | % {

Loading…
Cancel
Save