Skip to content

feat(aothashcheck): Add SP/CD hash verification with missing-file detection#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-pwsh-aothashcheck-support
Draft

feat(aothashcheck): Add SP/CD hash verification with missing-file detection#1
Copilot wants to merge 2 commits intomainfrom
copilot/update-pwsh-aothashcheck-support

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 10, 2026

aothashcheck.ps1 only checked main episode .mkv files. This extends it to also verify Special Features and CDs stored under M:\Anime-BDSPs\, matching against the existing Z-drive paths, with explicit detection of files missing on Z-drive.

Changes

New "what to check" prompt

After selecting season and hash algorithm, the user now picks:

  • 1 — Main Episodes only (original behavior)
  • 2 — SPs / CDs only
  • 3 — Both

SP/CD path config ($SpConfig)

Parallel to $Config, maps each season to its BDSPs M-drive root and the same Z-drive base path used by main episodes:

$SpConfig = @{
    "4" = @{
        PathM = 'M:\Anime-BDSPs\Attack on Titan.进击的巨人\Season 4\'
        PathZ = 'Z:\Downloads\Anime\[VCB-Studio] Shingeki no Kyojin\[BeanSub&VCB-Studio] Shingeki no Kyojin The Final Season [Ma10p_1080p]\'
    }
}

SP/CD check block

  • Recursive file enumeration from M-drive SP path; excludes .ass subtitles and *Fonts*.7z archives
  • Filename-exact matching against a pre-built recursive Z-drive file list; when multiple candidates share a name, prefers the one whose parent directory matches (handles (flac) vs (flac+webp) path drift)
  • Missing file logging: files on M-drive with no Z-drive counterpart are printed with their full path and counted separately as Missing (distinct from main-episode Skipped)
  • Reuses the identical ForEach-Object -Parallel / ThrottleLimit 2 hash logic and output formatting

Per-section summaries

Main episodes print "Main Episodes Summary"; SPs/CDs print "SPs/CDs Summary" with Compared / Missing fields. Both run sequentially when mode 3 is selected.

Original prompt

Update pwsh/aothashcheck.ps1 to support checking Special Features (SPs) and CDs in addition to the main episodes.

Requirements:

  1. Add a prompt to ask the user what to check: Main Episodes, SPs/CDs, or Both.
  2. Add SP M-drive paths to the configuration (e.g., M:\Anime-BDSPs\Attack on Titan.进击的巨人\Season 1, Season 2, Season 3, Season 4). The Z-drive paths remain the same as the main episodes, but for SPs we'll recursively search for matching files in the Z-drive path.
  3. When checking SPs/CDs, recursively get all files in the M-drive SP path.
  4. Exclude .ass files and files matching *Fonts*.7z (e.g. [BeanSub&VCB-Studio] Shingeki no Kyojin The Final Season [Fonts].7z) from the check.
  5. Find the corresponding file in the Z-drive by matching the exact file name ($_.Name -eq $fM.Name). Since folder paths might slightly differ between M and Z (e.g., (flac+webp) vs (flac)), match primarily by filename. If multiple files with the same name are found, you can either pick the first or match the parent folder name heuristically. If a file is missing on the Z-drive, explicitly log it as missing.
  6. Calculate hashes for the matched files and compare them using the existing parallel hash logic. Keep the formatting and performance of the original script.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: 现在除了1 2 3 4季 我还希望检查特典(SP),特典不止要检查里面的每一个文件,还要查看缺失的文件 特典的结构如下所示
❯ Get-ChildItem -Directory -Recurse -LiteralPath "Z:\Downloads\Anime[VCB-Studio] Shingeki no Kyojin[BeanSub&VCB-Studio] Shingeki no Kyojin The Final Season [Ma10p_1080p]"

    Directory: Z:\Downloads\Anime[VCB-Studio] Shingeki no Kyojin[BeanSub&VCB-Studio] Shingeki no Kyojin The Final
Season [Ma10p_1080p]

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----            4/9/2026  6:26 PM                CDs
d----           4/10/2026  6:43 AM                SPs

    Directory: Z:\Downloads\Anime[VCB-Studio] Shingeki no Kyojin[BeanSub&VCB-Studio] Shingeki no Kyojin The Final
Season [Ma10p_1080p]\CDs

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           4/10/2026  4:31 AM                [210203] 「衝撃」/安藤裕子 (flac+webp)
d----            4/9/2026  6:24 PM                [210203] 「衝撃」/安藤裕子 [24bit_96kHz] (flac)
d----            4/9/2026  5:42 PM                [210222] 「僕の戦争」/神聖かまってちゃん [24bit_96kHz] (flac)
d----           4/10/2026  6:02 AM                [210707] SPCD 01 Drama 「雨宿りの情景 特別編〜雨の古城にて〜」 (flac)
d----           4/10/2026  6:02 AM                [210804] SPCD 02 Drama 「雨宿りの情景 特別編〜雨の古城にて〜」 (flac)
d----            4/9/2026  6:24 PM                [220110] 「悪魔の子」/ヒグチアイ [24bit_96kHz] (flac)
d----           4/10/2026  5:08 AM                [220124] 「悪魔の子」/ヒグチアイ (flac)
d----            4/9/2026  6:18 PM                [220525] 「The Rumbling (Instrumental)」/SiM [24bit_96kHz] (flac)
d----            4/9/2026  7:26 PM                [220629] 「Rearrangement Reaction」/KOHTA YAMAMOTO [24bit_96kHz]
                                                  (flac)
d----           4/10/2026  2:17 AM                [231105] 「いってらっしゃい」/ヒグチアイ [24bit_48kHz] (flac)
d----            4/9/2026  3:04 PM                [240717] Original Sound Track Complete Album/KOHTA
                                                  YAMAMOTO、澤野弘之 (flac+webp)
d----           4/10/2026  2:37 AM                [240717] Original Sound Track Complete Album/KOHTA
                                                  YAMAMOTO、澤野弘之 [24bit_96kHz] (flac)
d----           4/10/2026  3:03 AM                [240807] 「進撃の記憶」/Linked Horizon (flac)
d----            4/9/2026  3:39 PM                [241002] 「悪魔の子 - from CrosSing」/石川由依 [24bit_96kHz] (flac)
d----           4/10/2026  3:22 AM                [241225] 「PLAYDEAD -DELUXE EDiTiON-」/SiM [24bit_96kHz] (flac)

    Directory: Z:\Downloads\Anime[VCB-Studio] Shingeki no Kyojin[BeanSub&VCB-Studio] Shingeki no Kyojin The Final
Season [Ma10p_1080p]\CDs[210203] 「衝撃」/安藤裕子 (flac+webp)

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           4/10/2026  6:31 AM                Scans

    Directory: Z:\Downloads\Anime[VCB-Studio] Shingeki no Kyojin[BeanSub&VCB-Studio] Shingeki no Kyojin The Final
Season [Ma10p_1080p]\CDs[240717] Original Sound Track Complete Album/KOHTA YAMAMOTO、澤野弘之 (flac+webp)

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           4/10/2026  2:46 AM                PCCG-02364-1
d----           4/10/2026  5:39 AM                PCCG-02364-2
d----           4/10/2026  2:23 AM                PCCG-02364-3
d----            4/9/2026  9:22 PM                Scans
以及整理后的: 他们的文件名都一样 只是可能缺失文件 和路径不同而已
❯ Get-ChildItem -Directory -Recurse -LiteralPath "Z:\Downloads\Anime[VCB-Studio] Shingeki no Kyojin[BeanSub&VCB-S...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Update aothashcheck.ps1 to include SPs and CDs checking feat(aothashcheck): Add SP/CD hash verification with missing-file detection Apr 10, 2026
Copilot AI requested a review from Dr1mH4X April 10, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants