Hi everyone,
If you’ve ever deleted a folder from your NAS or hard drive and noticed that Kodi still tries to scan it—or if your logs are full of `Process directory '...' does not exist - skipping scan`—you know that Kodi’s built-in "Clean Library" doesn't always finish the job.
It removes the movies/episodes, but it often leaves the underlying **path references** in the SQLite database (`MyVideosXX.db`). This leads to "ghost" entries and slower library updates.
I built **Library Cleaner** to solve this once and for all.
### 🛡️ What it does:
It uses a **dual-layer cleanup** approach:
**JSON-RPC API (Safe):** Scans movies, shows, and episodes, checking them against the filesystem and removing orphaned entries via the official API.
**SQLite Deep Clean (The Fix):** This is the key. It directly cleans the `path`, `files`, and `art` tables in your database that Kodi’s native cleaner never touches.
### ✨ Key Features:
* **Automatic Service:** Runs in the background at configurable intervals (default: 24h).
* **Dry-Run Mode:** Preview exactly what would be deleted before making changes.
* **Safety First:** It creates an automatic timestamped database backup before every deep clean.
* **Smart Logic:** Skips network paths (SMB/NFS) by default to prevent accidental deletions if a share is offline.
* **Idle Only:** Only runs when Kodi is idle (no playback, no active scans).
### 🚀 Getting Started:
The addon is compatible with Kodi 19+ (Matrix, Nexus, Omega) and has been tested extensively on LibreELEC (Raspberry Pi 5).
**GitHub Repository:** [Link zu deinem Repo einfügen]
I'd love to get some feedback! If you have many "phantom" paths in your library, give the **Dry-Run** a try and see what it finds.