Why does Plex delete folders empty?

So I have a folder structure like this:

TV
----Cop Shows
----------Show1
----------Show2
----Drama
----------Show3
----------Show4

When I have watched an episode I always delete it thru Plex. However in the most recent versions of the server, when the episode being deleted is the last file in the folder, the folder is also deleted. This is very annoying and I assume it is a bug. Is there a setting to disable this? I can’t find one but may be missing it.
If there isn’t an option then Plex should not be deleting folders when it was only asked to delete a file.

Thanks.

No bug - that is the intended behavior (at this time).

Note:

TV <— if that is your TV Show Library this structure is destined to fail.
----Cop Shows <— if this is just one of your TV Show Libraries - all is well.
----------Show1
----------Show2
----Drama
----------Show3
----------Show4

This isn’t what’s causing the folder deletion, but while you wait for Plex to notice they’re not making some users happy with their design change and scramble to fix it (that’s funny just thinking about it and even funnier when I write it down) you could spend some quality time with your TV Show Library Structures/File Names (haven’t seen those yet) bringing them into compliance (if necessary):

The current ‘work-around’ (and what most of us have been doing since day one for another reason) is to leave one ‘seed-episode’ in the folder.

Thanks…and yeah, my libraries are under the TV show level. So a library for Cop Shows, Drama, Comedy etc. It was all organised a couple of years ago when I started using Plex and never had an issue with it.
All was fine until very recently and it worked brilliantly. Now with this issue and a distinct change in how auto-refreshing of folders is operating, (or not operating as the case may be) I have had to download EMBY again to see if it is any better. The last couple of weeks has really been a step backwards unfortunately for Plex.
I read thru that page you linked and all is well with my structure I believe. Ill give that seed file a go. Does it have to be an actual episode or will something like a txt file do?

An empty txt fie works to stop it deleting the folder it seemswhen last episode deleted…thanks for the tip.

@ger.kehoe said:
An empty txt fie works to stop it deleting the folder it seemswhen last episode deleted…thanks for the tip.

That’s handy info that can be passed on to the next user surprised by the new ‘feature’. I suggested just leaving the last episode in there, but if your method works, it works as a ‘work-around’.

I like leaving the last episode 'cause at my age I tend to forget what happened when I left it the last time - and as soon as I place a new episode in it snaps the new episode to On Deck right where I left off.

Plex should not be messing with folder structure at all, but if it does, this should not start as new default behaviour.

btw, this works on *nix to create blank files in all folders
find /path/to/your/library/ -type d -exec touch {}/empty.txt ;

They may say this is “by design”, but it’s BAD design to implement a destructive feature that changes prior behavior without making it a configurable option! And also without warning! I thought I was going crazy until I came across this thread.

Thanks all, for the work-arounds. Now I’m off to create a bunch of silly empty text files…

Well, this is absolutely unacceptable, and no reason to create such a design. As well, take into consideration those of us who use things like SIckbeard to place things in existing folders…well guess what…the folders are gone (by design!) and will cause failures.

Yes, an empty text file will work just fine, but that should not be necessary in the first place.

I actually like the ‘new way’. I leave a ‘seed-episode’ in the folder, but when I don’t need the folder any more I like that I don’t have to hunt it down to delete it.

It wouldn’t mind it if it was an optional setting (off by default)

Thanks for the txt file solution - this was driving me nuts!

@“MovieFan.Plex” mentioned another method in a different thread the other day…

Another option you can consider, instead of creating text files is to not use Show folders.
Since you are not keeping the files, there is no need to organize them with the regular folder structure.
Have the library point to a folder (D:\TV Show Episodes) for example, and stick all your files in there.

D:\TV Show Episodes\Show 2 - S05E07.mkv
...
D:\TV Show Episodes\Show 20 - S09E10.mp4

Even if this folder goes empty, Plex won’t delete it.

Except if you have a device that requires DNLA due to not having a Plex app for the device… At which point, a large quantity of shows in one single folder makes life a headache… whereas seperating them into folders makes it easier to find what you are looking for…

Now get the Plex devs to make apps for older Blu-Ray Players (ones that have Netflix, and Hulu apps and such)… And then we can talk about not having to use DNLA…

@“ger.kehoe” said:
If there isn’t an option then Plex should not be deleting folders when it was only asked to delete a file.

This. Any statement from Plex on this?

Appreciate the empty text file recommendation, as a workaround.

I have experienced the deletions. I think I added a zero byte file to a folder that was then deleted. I am not sure so I set up a test with 3 folders. Empty, zero-byte TXT, and a TXT with some text. After a day I checked and they’re all still there. When does the empty folder clean-up occur?