Pain & Suffering. Cleanup Jellyfin Libraries
Описание и применение
В Jellyfin при удалении папок из файловой системы остаются «висячие» ссылки, которые ломают сканирование библиотек. Скрипт на Bash позволяет остановить сервис, найти и удалить соответствующие записи в SQLite‑базе, после чего библиотека пересканируется без ошибок.
Задача
Jellyfin ignores filesystem deletions, leaving dangling references that break library scans and prevent new files from being recognized.
Результат
Dangling references are removed and the library rescans without errors, restoring normal media discovery.
Рабочий процесс
- Delete the folder from the Jellyfin UI if present
- Stop the Jellyfin service via Dashboard or systemctl
- Locate and backup the Jellyfin SQLite database (e.g., /var/lib/jellyfin/data/jellyfin.db)
- Install sqlite3 if missing
- Search the BaseItems table for items matching the deleted folder name
- Delete those items and their children from the database
- Start Jellyfin
- Run a library rescan for the affected folder and verify no errors
Доказательства
Jellyfin still has the references to those files, but they are absent in the filesystem. This breaks the library scanning and Jellyfin won't be able to recognize new files when you add them.
Here's a bash script to automate the deletion step
- Дата записи: 2026-09-06T15:36:45.653Z