feat(archive): 新增 media-archive,一键把整理好的目录归档进媒体库
- scripts/media_archive.py:按目录名里的 [tmdbid-N] 查 TMDB,结合 original_language / origin_country / genres 给出分类建议;交互选择或 --to 指定; 同盘 os.rename(跨盘回退 shutil.move),目标存在则拒绝,移动后校验文件数/体积; 可选触发 Jellyfin /Library/Refresh - scripts/media-archive.ps1 + remote-common.ps1:Windows 侧包装,路径翻译与 media-rename 共用 - 右键菜单新增「SceneRename 归档」,共 10 个注册项 - deploy.ps1 同时安装 /usr/local/bin/media-archive
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#Requires -Version 7.0
|
||||
<#
|
||||
.SYNOPSIS
|
||||
资源管理器右键菜单的入口:把选中的文件夹(或视频文件所在目录)交给 media-rename。
|
||||
资源管理器右键菜单的入口:把选中的文件夹(或视频文件所在目录)交给 media-rename / media-archive。
|
||||
|
||||
.DESCRIPTION
|
||||
由 install-explorer-menu.ps1 注册到:
|
||||
@@ -9,6 +9,9 @@
|
||||
- 文件夹空白处右键(当前目录)
|
||||
- .mkv / .mp4 / .avi 文件右键(取其所在目录)
|
||||
|
||||
.PARAMETER Action
|
||||
rename(默认)= 规范化流水线;archive = 归档进媒体库。
|
||||
|
||||
.PARAMETER Pause
|
||||
执行结束后停住窗口,便于查看输出(由右键菜单传入)。
|
||||
|
||||
@@ -17,6 +20,8 @@
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('rename', 'archive')]
|
||||
[string]$Action = 'rename',
|
||||
[switch]$Pause,
|
||||
[Parameter(ValueFromRemainingArguments = $true)][string[]]$Paths = @()
|
||||
)
|
||||
@@ -24,6 +29,11 @@ param(
|
||||
$ErrorActionPreference = 'Stop'
|
||||
try { [Console]::OutputEncoding = [Text.Encoding]::UTF8 } catch { }
|
||||
|
||||
$runner = switch ($Action) {
|
||||
'archive' { 'media-archive.ps1' }
|
||||
default { 'media-rename.ps1' }
|
||||
}
|
||||
|
||||
$target = $Paths | Where-Object { $_ } | Select-Object -First 1
|
||||
|
||||
if (-not $target) {
|
||||
@@ -37,7 +47,7 @@ if (Test-Path -LiteralPath $target -PathType Leaf) {
|
||||
}
|
||||
|
||||
Write-Host "📁 目标: $target" -ForegroundColor DarkGray
|
||||
& (Join-Path $PSScriptRoot 'media-rename.ps1') -Tokens @($target)
|
||||
& (Join-Path $PSScriptRoot $runner) -Tokens @($target)
|
||||
$code = $LASTEXITCODE
|
||||
if ($null -eq $code) { $code = 0 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user