|
|
|
@ -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 | % { |
|
|
|
|