I’m using the latest Plex Media Server on a Synology DS218+ with multiple clients.
One of my libraries is my “Downloads” folder where I download movies to, but later either delete or move them to another folder.
The problem is that the server won’t remove the deleted items - the folder will still be there, either empty or with the movie itself labeled as unavailable. Yes, I know that Plex isn’t designed primarily to be browsed by folders, but for a temporary directory with mixed content there is no reason to setup a media library.
This problem happens since an update that happened a few months ago, did not have the problem before.
I have tried all the tips found here, including empty the trash, allow media deletion, scan, refresh metadata, etc. The only workaround I have is to temporarily change the library to a completely different folder then revert to the original, but of course it is inconvenient… Any change to make this work again?
The new scanners do behave differently.
You should make sure to have Scheduled Tasks set to keep the database in proper state. This includes Emptying the trash, cleaning the bundles, and optimize database (all checkboxes you’l find there).
Deleting media is intended for DVR which doesn’t usually create the different structures most 3rd party clients do. Movies are intended to be permanent while television DVR can be both perm or temporary.
Common tools such as FileBot, which do run automated, are designed to move things and clean up after themselves. IIRC, download clients are the same.
You can also write a fairly simple script (Task Scheduler) to look for empty directories and delete them.
Remember, the empty directory isn’t so much the problem as the database not being in sync with the actual files on disk.
Only one scheduled maintenance task was not enabled (update libraries), I have enabled that too and set scheduled tasks to run from 1-7AM. Unfortunately 2 days have passed and there is no change.
Anything else I could do? Unfortunately I am not familiar with script writing and I can’t find a way to manually remove empty directories either.
No problem. I delete the media (folders and files) via Total Commander and yes, they are no longer removed from the library even after scan, analyze, empty trash etc.
Sure. The library consists of a shared folder on the Synology NAS with the appropriate permissions set.
Let’s say I create a new directory. Keeping the web client open in the browser I can see scanning activity within seconds hence the new content is detected.
However if I delete the directory later (via a file manager), it won’t be removed even if I empty the trash. If there were media files in the directory, they would still show up in the library with a status “unavailable”, and then they can be removed manually within the web client (via trash icon), however I see no method to remove the empty directory.
Content removed at a file level used to be removed from the library at the next scan, but this stopped working for me a few months ago. Of course I tried to delete the library altogether and create it again, but nothing has changed.
If you remove too far “up” the tree. PMS will think the media isn’t available.
Consider “USB drives”.
The top level is gone because the drive is unplugged.
Should PMS delete all the content or should it wait?
Marking as unavailable is deliberate. It used to delete blindly. Now it waits until it sees that top-most directory again.
If the top-most (the referenced) directory exists but is empty, THEN it’s ok to delete.
To get out of this, Create that top -most directory and leave it empty.
Let it all scan and remove.
After it’s all gone, Remove the directory from the Library list.
Lastly, remove the directory.
The library points to DownloadFolder (a shared folder on the NAS). Even if I create an empty folder e.g. DownloadFolder\test, it gets added to the library and I find no way to remove it (won’t be removed after file level deletion). It might be important to point out that I use all of my libraries in Folders view.