BUG: Entry in library are left behind when last file is removed

Hi, there seems to be an issue with removing the last item in a library, it leaves the entry (thumbnail, meta, possibly in the DB) but with no file associated.

The preferred outcome would probably be as when the library is first created and it says something like “This Library Is Empty”.

Logs: Plex Media Server Logs_2019-06-29_09-07-47.zip (2.0 MB)
(Turned off verbose, kept debug logging, restarted server, and recreated the issue)

These are the versions that this has been tested on:
Plex Media Server (Linux): 1.16.0.1226
(Running on Debian: 9.9)

Plex Android Client: 7.17.2.11085
(Running on: Android: 9)

Plex Android Client: 7.17.2.11085
(Running on Nvidia Shield (2017): 8.0.0)

Plex Web Client: 3.95.2
(Running on Chrome: 75.0.3770.100
and Windows 10 x64 Pro: 1903 18362.175)

Similar threads were found without a solution:

Thank you in advance, and I really hope this isn’t to much of a hassle to sort out.
Have a great day!

//MrBamse

This is intended behaviour.
If Plex cannot find any file (literally any file, it doesn’t have to be a media file), it assumes that the media storage is temporarily not available (server down, cable unplugged etc.) and won’t change anything.

Why don’t you erase the library?

Another workaround is to put a small text file into the folder.

Fair enough, but when its the last item in the library, shouldn’t behavior be to remove/hide that last entry? The “risk” is one item and I do understand if more than one file has been “suddenly” unavailable but it seems like the logic should be “if <= 1 then empty”.

Because if another file is moved into the library the “old one” get removed. It’s only there as a ghost until something else has been added to the library.

The reason for not removing the library is that new files are added to it, watched, verified, fixed (if necessary) and then moved to the archive library.

I explained it initially. If there are no files at all, Plex will not touch the library.
Put a text file into the folder and be done with it.

okay
thank you
im sorry

Maybe it would be better if the test for library availability was “is the folder available” instead of “is there a file in the folder”?

Don’t forget that Plex is running on a plethora of OS’es and there are several ways of mounting folders/drives/shares on each. Some ways for “checking the presence of a folder” are not available on every OS (or may not work with all file systems/ways of mounting them).
The way it is is the most practical method of them all.

Plus your use case of a completely empty library is an edge case, IMHO.

True
Easiest at least

But wait, if the reason for this behavior is that Plex shouldn’t touch the library if the storage goes temporarily offline. How come it doesn’t care about this when multiple storage locations are added to one library and one of those storage locations goes offline? Why would the desired behavior be that PMS removes entry 100,99,98…all the way down to 2 but not the last one because “then something must be wrong”?

And what is located in the additional folders?

Other video files.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.