DeepSeek Harness Plugin: dsh-plugin-media-naming

Preface

The core philosophy of DeepSeek Harness (DSH) is “Everything is a plugin.” When media servers (such as Jellyfin or Emby) fail to correctly recognize the structure of your resource directory, manual renaming is both time-consuming and error-prone. The dsh-plugin-media-naming plugin aims to solve this problem. Through preset rule packs, it standardizes specified directory names and video filenames into forms recognizable by media servers, supporting both the 115 Web Drive and local/NAS environments.

Plugin Overview

  • Name: dsh-plugin-media-naming
  • Core Value: Unified naming for media libraries; standardization of directory names and video filenames.
  • Environment Support: Automatically detects 115 Web Drive or local/NAS/Linux paths.
  • Maintainer: CustomLZH
  • License: MIT

Core Features

  1. Unified Media Naming: Standardizes directory names and video filenames.
  2. Dual Environment Support: Automatically detects 115 Web Drive or local/NAS/Linux paths without manual switching.
  3. Plan First, Execute Later: Generates a review checklist that must be confirmed before execution to avoid erroneous operations.
  4. Checkpoint Resume & Rollback Support: Manages execution state via apply-state.json and rollback.json.

Installation & Dependencies

Prerequisites

Dependency Required? Description
DSH Yes Plugin host
Node.js ≥ 18 Yes The plugin and local backend are JS-based
Python ≥ 3.10 + p115client Only for 115 Web Drive Python is completely unnecessary if only processing local/NAS files

Installation Steps

  1. Clone the repository to any directory:
    git clone https://github.com/CustomLZH/dsh-plugin-media-naming.git
  1. Install and enable it as a bundle in DSH’s plugin management (via plugin_manager: install_bundle → set_bundle → set_plugin).
  2. Restart DSH. The plugin code involves module caching, so a restart is required to load changes after modifying the code.

Environment Self-Check

After installation, verify the environment using the following commands:

npm test                           # Run all tests in one click
node test/local-storage-test.mjs   # Run only the local/NAS backend tests

Typical Usage

The plugin provides a suite of tools to handle the entire workflow from scanning to execution.

1. Initial Preparation (115 Web Drive Only)

If you need to operate on 115 Web Drive resources, perform a QR code login first:

py -u python/login_115.py                 # Display QR code in terminal, scan to confirm
py -u python/login_115.py --png qr.png    # Generate a QR code image (for display)
py -u python/login_115.py --self-check    # Check environment only, no network connection

Credentials are automatically written to the local config.json upon successful authentication.

2. Generate Review Checklist

Use the media_naming_quick tool to specify the target path and generate a review checklist:

// Organize 影视资源/电视剧/某剧 (2026)
dsh media_naming_quick target="影视资源/电视剧/某剧 (2026)"

This command returns a review checklist listing the files and directories that need modification, along with the basis for the changes.

3. Execute Modifications

After verifying the review checklist, use media_naming_apply to complete the modifications and perform an automatic re-verification:

// Proceed
dsh media_naming_apply confirm=true

Workflow & Safety Mechanisms

Collaborative Workflow

  • Plugin: Responsible for providing rules, calculating plans, and determining correctness.
  • Agent: Responsible for workflow orchestration, displaying the review checklist, and executing after confirmation.
  • You: Responsible for specifying the directory and auditing/approving the plan.

Execution Gate

Two conditions must be met before executing write operations:
1. User Confirmation: The Agent must first present the review checklist to you.
2. Clean Plan: conflict = 0, unknown = 0, and no duplicate targets.

Processing Scope

  • Only processes video files declared in the rule pack; subtitles, NFOs, and posters remain untouched.
  • Credentials are written only to the local configuration file; they are not echoed or output in any artifacts.
  • A DSH restart is required for code changes to take effect.

Rule Packs & Configuration

The plugin includes a rules/ directory containing rule configurations and sample data. libraries serves as a mapping rather than a whitelist; the rule applies if any segment in the path matches. To switch rule packs, you can create a new rules/<id>/ directory and register it, or pass rulePackPath during invocation.

References

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye