From 51dae0f48ecfb5ad9a27eb95b29b6c9de72adb18 Mon Sep 17 00:00:00 2001 From: pcnick Date: Sun, 8 Oct 2023 23:12:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A5=E5=8F=83=E6=95=B8=E5=BD=88=E6=80=A7?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E8=B3=87=E6=96=99=E6=AA=94=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Animelibk.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Animelibk.ps1 b/Animelibk.ps1 index 9edacdc..a70ea8c 100644 --- a/Animelibk.ps1 +++ b/Animelibk.ps1 @@ -2,6 +2,7 @@ $Path, $Index = "H:\AnimeLib", $VarConfig, + $RecorDB = "animelibk.ini", [switch] $Single, [switch] $Force, [switch] $Sub @@ -55,11 +56,12 @@ if ($VarConfig) { #$Path = "L:\Anime\202004 ストライク・ザ・ブラッド OVA IV\[Suzu-Kaze][Strike_the_Blood_IV_OVA][01-12FIN][BDRip_1080P][HEVC_YUV420P10]\[Suzu-Kaze] Strike the Blood IV 12FIN [BDRip 1920x1080 HEVC YUV420P10 FLAC].mkv" #$Path = "H:\Anime\201901 盾の勇者の成り上がり\[LKSUB][Tate no Yuusha no Nariagari][01-25][GB][720P][MP4]\[LKSUB][Tate no Yuusha no Nariagari][01][GB][720P].mp4" $JsonPath = $("$Index\Anime\* $TargetName", $($Path -replace '(.*\\[^\[\\\]]*)\\\[.*', '$1') | ? {Test-Path $_}) -$WorkData = $(if (Test-Path "$JsonPath\animelibk.json") { - Get-Content "$JsonPath\animelibk.json" | ConvertFrom-Json +$WorkData = $(if (Test-Path $RecorDB) { + Get-Content $RecorDB | ConvertFrom-Json } else { - "" | select ID, WorkName, TargetName, DestinName, Season, Episode + "" | Select-Object ID, WorkName, TargetName, DestinName, Season, Episode }) +if ($RecorDB -notmatch ":") { $RecorDB = "$JsonPath\$RecorDB" } # 確認資料狀態,缺少則進行物件資料建立 if (-not($WorkData.WorkName)) { @@ -167,5 +169,5 @@ $ENDResult = $BuildList | % { #$ENDResult #$ENDResult.gettype(); if (-not($Sub)) { $ENDResult | % { if ($_.Episode) { $WorkData.Episode += $_.Episode }}} -$WorkData | ConvertTo-Json | Out-File -Encoding "UTF8" "$JsonPath\animelibk.json" +$WorkData | ConvertTo-Json | Out-File -Encoding "UTF8" $RecorDB exit 0; \ No newline at end of file