# Media Library Organizer

> Use when organizing media files (movies, TV, anime) on NAS or local storage - cleaning junk files, merging scattered episodes, normalizing folder names to "Title (Year)" format, and verifying episode completeness against TMDB

- **Type:** Skill
- **Install:** `agentstack add skill-innei-media-library-organizer-skill-media-library-organizer-skill`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Innei](https://agentstack.voostack.com/s/innei)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Innei](https://github.com/Innei)
- **Source:** https://github.com/Innei/media-library-organizer-skill

## Install

```sh
agentstack add skill-innei-media-library-organizer-skill-media-library-organizer-skill
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Media Library Organizer

## Overview

Systematically clean, merge, rename, and verify media libraries so that Jellyfin/Emby/Plex can correctly identify and scrape all content.

## When to Use

- Media directory has messy folder names with encoding info
- Same show scattered across multiple folders
- Junk files wasting space
- Need to verify episode completeness against TMDB

## Workflow

```dot
digraph media_org {
  rankdir=TB;
  "1. Scan & Analyze" -> "2. Clean Junk";
  "2. Clean Junk" -> "3. Identify Duplicates";
  "3. Identify Duplicates" -> "4. Merge Scattered Episodes";
  "4. Merge Scattered Episodes" -> "5. Normalize Folder Names";
  "5. Normalize Folder Names" -> "6. Verify vs TMDB";
  "6. Verify vs TMDB" -> "7. Report & Confirm Deletion";
}
```

## Steps

Each step has detailed instructions and reusable scripts:

1. **[Scan & Analyze](docs/scan-and-analyze.md)** - Survey directory, identify issues, generate report
   - Script: `scripts/scan-media.sh`
2. **[Clean Junk](docs/clean-junk.md)** - Remove temp files, empty dirs, orphan fragments
3. **[Identify Duplicates](docs/identify-duplicates.md)** - Find same content across folders by title/year matching
4. **[Merge Scattered Episodes](docs/merge-scattered-episodes.md)** - Combine split episodes into one folder
   - Script: `scripts/check-episodes.sh`
5. **[Normalize Folder Names](docs/normalize-folder-names.md)** - Rename to `Title (Year)` format
   - Script: `scripts/normalize-names.sh`
6. **[Verify vs TMDB](docs/verify-against-tmdb.md)** - Compare local episode count against TMDB
7. **[Report & Confirm](docs/report-and-confirm.md)** - Present findings, wait for user confirmation

## Common Mistakes

| Mistake | Fix |
|---------|-----|
| Renaming folders breaks PT/BT seeding | Confirm with user if they're still seeding |
| Gap detection only checks internal gaps | Must compare against TMDB total count |
| macOS `grep` lacks `-P` flag | Use `egrep -o` instead of `grep -oP` |
| `sed` with multi-line input fails on macOS | Use `awk` for complex text processing |
| Merging without checking overlaps | Always verify no episode overlap before merge |
| Guessing Chinese titles from English | Search TMDB/MyDramaList for authoritative names |
| Movie in TV folder or vice versa | Check if content is film or series before placing |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Innei](https://github.com/Innei)
- **Source:** [Innei/media-library-organizer-skill](https://github.com/Innei/media-library-organizer-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-innei-media-library-organizer-skill-media-library-organizer-skill
- Seller: https://agentstack.voostack.com/s/innei
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
