|  |  |  | @ -3,7 +3,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |     $Index = "H:\AnimeLib", | 
			
		
	
		
			
				
					|  |  |  |  |     $VarConfig, | 
			
		
	
		
			
				
					|  |  |  |  |     $RecorDB = "animelibk.ini", | 
			
		
	
		
			
				
					|  |  |  |  |     $Include = @(".rmvb", ".mp4", ".mkv", ".ass", ".ssa"), | 
			
		
	
		
			
				
					|  |  |  |  |     $Include = @(".rmvb", ".mp4", ".mkv", ".avi", ".ass", ".ssa"), | 
			
		
	
		
			
				
					|  |  |  |  |     [switch] $Single, | 
			
		
	
		
			
				
					|  |  |  |  |     [switch] $Force,  | 
			
		
	
		
			
				
					|  |  |  |  |     [switch] $Sub, | 
			
		
	
	
		
			
				
					|  |  |  | @ -94,7 +94,7 @@ $Year = @($($JsonPath -replace '.*\\((?<Y>\d{4})?(?<M>\d{2})?).*$', '${Y}'), $(g | 
			
		
	
		
			
				
					|  |  |  |  | # 依目標檔案位置變更磁碟代號 | 
			
		
	
		
			
				
					|  |  |  |  | $TargetDrive = Split-Path -Path $JsonPath -Qualifier | 
			
		
	
		
			
				
					|  |  |  |  | if (Split-Path -Path $Index -IsAbsolute) { | 
			
		
	
		
			
				
					|  |  |  |  |     if ($Index -match $TargetDrive) { | 
			
		
	
		
			
				
					|  |  |  |  |     if ($Index -notmatch $TargetDrive) { | 
			
		
	
		
			
				
					|  |  |  |  |         $Index2 = Join-Path -Path $TargetDrive -ChildPath (Split-Path -Path $Index -noQualifier) | 
			
		
	
		
			
				
					|  |  |  |  |     } else { | 
			
		
	
		
			
				
					|  |  |  |  |         $Index2 = $Index | 
			
		
	
	
		
			
				
					|  |  |  | @ -102,6 +102,7 @@ if (Split-Path -Path $Index -IsAbsolute) { | 
			
		
	
		
			
				
					|  |  |  |  | } else { | 
			
		
	
		
			
				
					|  |  |  |  |     $Index2 = Join-Path $TargetDrive $Index | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | Write-Host $Index2 | 
			
		
	
		
			
				
					|  |  |  |  | # 取得目標資料夾是否存在,不存在建立資料夾,並取得資料夾物件 | 
			
		
	
		
			
				
					|  |  |  |  | $LinkPath = "{2}\{0}\{1}" -f $WorkData.DestinName, $($Lang["Season"] -f $WorkData.Season), $Index2 | 
			
		
	
		
			
				
					|  |  |  |  | $LinkDir = $(if (-not(Test-Path -Path "$LinkPath*")) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -160,7 +161,7 @@ if ($Single) { | 
			
		
	
		
			
				
					|  |  |  |  |     # 單集模式 | 
			
		
	
		
			
				
					|  |  |  |  |     $List = @(Get-Item -Path $(Edit-PathChar $Path)) | 
			
		
	
		
			
				
					|  |  |  |  |     $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) { | 
			
		
	
		
			
				
					|  |  |  |  |     $List = @(Get-Item -Path $(Edit-PathChar $Path)) | 
			
		
	
		
			
				
					|  |  |  |  |     $BuildList = $List | select $FileObj, $StructPathObj, $NewNameObj | ? {$_.File.Extension -in @(".ass", ".ssa")} | 
			
		
	
	
		
			
				
					|  |  |  | @ -178,7 +179,7 @@ $ENDResult = $BuildList | % { | 
			
		
	
		
			
				
					|  |  |  |  |     $Command = @{ | 
			
		
	
		
			
				
					|  |  |  |  |         ItemType = 'HardLink' | 
			
		
	
		
			
				
					|  |  |  |  |         Path = $("{0}\{1}" -f $_.StructPath, $_.NewName.newFullName) | 
			
		
	
		
			
				
					|  |  |  |  |         Target = $(Edit-PathChar $_.File.Fullname) | 
			
		
	
		
			
				
					|  |  |  |  |         Target = $(Edit-PathChar $_.File.Fullname -nowlid) | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |     #try { | 
			
		
	
		
			
				
					|  |  |  |  |         if (New-Item @Command) {  | 
			
		
	
	
		
			
				
					|  |  |  | @ -192,4 +193,4 @@ $ENDResult = $BuildList | % { | 
			
		
	
		
			
				
					|  |  |  |  | #$ENDResult.gettype(); | 
			
		
	
		
			
				
					|  |  |  |  | if (-not($Sub)) { $ENDResult | % { if ($_.Episode) { $WorkData.Episode += $_.Episode }}} | 
			
		
	
		
			
				
					|  |  |  |  | $WorkData | ConvertTo-Json | Out-File -Encoding "UTF8" $RecorDB | 
			
		
	
		
			
				
					|  |  |  |  | exit 0; | 
			
		
	
		
			
				
					|  |  |  |  | exit 0; | 
			
		
	
	
		
			
				
					|  |  |  | 
 |