Folder View Update After File Restructure

All:

I recently found PLEX and love the platform! This is the media solution I have been looking for to manage my movie collection for years.

I initially installed the Plex app on my windows based media server and loaded my movie collection before realizing the proper folder structure. Before reading the best practices of media prep I was keep each movie in its own folder under the root of my movies folder. For example I had the following:
/Movies
/movie 1
/ movie 1.mp4
/ movie 2
/movie 2.mp4
/ movie 3
/ movie 3.avi

Now that I see how Plex reads media and presents it in the app I’ve moved my content into the root of Movies as suggested in the media prep article.

The issue I am having is that when I use the view movies “by folder” my old folder structure still apears. When I click on the old folder icon the player show “There are no items in this library”. How can I get the media server to rescan the structure or delete these now empty folders?

Movie 1.mp4
should be
Movie 1 (YEAR).mp4 <— movie file names without (YEAR) are invalid/non-compliant

You should also visit:
Plexweb/Settings/Server/Agents/
under every list under Shows and Movies drag Local Media Assets to the bottom of the pile.

Then…

The Plex Dance®:

  1. remove show/movie(s) from library
  2. update library
  3. empty trash
  4. clean bundles
    https://support.plex.tv/hc/en-us/articles/200392106-Library-Actions <— update library, empty trash, clean bundles
  5. bring names and structures into compliance, fiddle with Local Media Assets, general fiddling, double check accuracy
  6. replace corrected show/movie(s) into library
  7. update library

All Steps. In Order. No Shortcuts.

The Plex Dance is always handy, but you may not need it just now as you may be seeing the farce of folder view for exactly what it is - a waste of time.

Stop viewing movies by folder. You don’t need it. It’s a safety net for folks that refuse to properly name and structure. When your media is prepared properly and matches properly and is beautifully displayed you don’t need an ugly folder view of every movie in your movie library 'cause without nested folders, folder view simply shows you every movie in your movie folder. If you are using nested folders for every movie in your movie folder, folder view shows you every movie in your movie folder. ‘By Folder’ is the express elevator to the booby hatch.

In fact this could be misleading you. If you aren’t using the madness of nested folders for every movie when viewing ‘by folder’ you are presented with every movie - the view you just left. Redundant redundancy absolutely certainly un-needed un-necessity.

Basically Plex responded to public outcry when they didn’t include ‘Folder View’ (that you don’t need) in the major overhaul last year. Beats me why anyone would want to view by folder, but there you go.

If you want to start creating ‘categories’, make new libraries and/or use the Sort Title Field in those new ‘Categorized Libraries’ to group movies together like:


You probably don’t need 26 Libraries - unless you do…


If you make a library for your Sets and Sequels having them line up right next to each other is really nice.. and that’s what the Sort Title Field can do: Star Trek 1979, Star Trek 1982, Star Trek 1984, and so on.

@kxcntry99 said:
I initially installed the Plex app on my windows based media server and loaded my movie collection before realizing the proper folder structure. Before reading the best practices of media prep I was keep each movie in its own folder under the root of my movies folder.

This is the proper method.
Don’t change it!
Just make sure that your folder name solely consists of the official Movie title followed by the release year in parentheses. Don’t use dots (or other characters) for spaces.

Now that I see how Plex reads media and presents it in the app I’ve moved my content into the root of Movies as suggested in the media prep article.

Scroll down a bit :wink:

The issue I am having is that when I use the view movies “by folder” my old folder structure still apears. When I click on the old folder icon the player show “There are no items in this library”. How can I get the media server to rescan the structure or delete these now empty folders?

Proper “move files” method is described here
https://support.plex.tv/hc/en-us/articles/201154537-Move-Media-Content-to-a-New-Location

but as I said, don’t put all your movie files into one big folder,
unless you never, ever want to make use of external subtitles, or custom posters or local extras etc pp.
Restrict the number of files in one folder to about 2,000 maximum.

On this point I vehemently, but respectfully disagree.

Plex will get me to put every one of my movies in a folder:

  1. When HELL freezes over
  2. Over my dead body

My subtitles and poster images work just fine, thank you…
Note the rogue jpg for ‘Rogue One Extras.mp4’ I neglected to delete when I deleted that crappy Extra File.
I do follow the instructions for folders when it comes to genuine Movie Extras, for to do otherwise would mean they wouldn’t work. We wouldn’t want that:

I will also mention that I don’t have 54 thousand movies in one giant Movie Library - another bit of madness, if you’ve ever used one of these wonderful Plex apps with that patented ‘Over and Under’ Horizontal Scrolling Nightmare Straight Out Of The Firey Depths Of (the unfrozen over) Hell (AKA: Ohio). The most I have in any one library is 200-250. Things move along very briskly - for me - and I don’t have two horizontal rows of tiny posters in rows that run to Mars.

@JuiceWSA said:
On this point I vehemently, but respectfully disagree.

Plex will get me to put every one of my movies in a folder:

  1. When HELL freezes over
  2. Over my dead body

You clearly don’t put all your videos in 1 folder nor put each and every single one into its own folder. Both methods are cumbersome in their own way.

So being that you organized your vids on your computer like a normal person does, and I do as well, why can’t Plex just purge folders like it does vids when I delete a folder from my library? And why would i not use Folder view since that’s how I organized the damn thing long before Plex came along?? I can switch back and forth deciding which is better for ME.
The Plex Dance® is not working. Plex has become seemingly intractable now on this issue…its been YEARS!!!

All I’m asking for is when I delete a Library folder, to get rid of the sub-folders as well as all the vids underneath it.
Why is that so hard? Is that seriously asking for too much? Why do I have to have all these empty folders sitting there irremovable??

I’m having a similar problem (stale folders after re-org), and just want to chime in that there are people (like me) who use Plex for other things than watching pirated Hollywood content. In my case, I have quite a lot of educational courses on a variety of topics, and these things tend to have their own (often rather nested) folder structures containing videos alongside PDFs or other documents. So the idea that folders are useless is quite wrong where people like me are concerned. Indeed, I’ve had to roll back to older versions of the Android app because the 7.x makes navigation much harder, as my top level sections in Plex are topics, not media types.

So far, the only way I’ve found to fix the folder GC issue is to create a whole new section and rebuild that way; I suspect I will ultimately have to muck about with Plex’s internal database to clean stale folders, especially if Plex continues to do updates that make it harder to use folders in the first place.

An update: I’ve created a script I can now run as a cronjob on my QNAP NAS to filter out pointless folders after nightly background maintenance finishes:

#!/opt/bin/bash
PATH="/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin"

PLEX_DB='/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db'

CRITERIA="FROM directories
WHERE id NOT IN (SELECT directory_id        FROM media_parts WHERE directory_id        IS NOT null)
  AND id NOT IN (SELECT parent_directory_id FROM directories WHERE parent_directory_id IS NOT null)
"

plexql() { sqlite3 "$PLEX_DB" "$@"; }

while [[ "$(plexql "SELECT COUNT(*) $CRITERIA")" != "0" ]]; do
    plexql "DELETE $CRITERIA"
done

Obviously the PATH and PLEX_DB settings are qnap-specific. But this should also be clear enough as a guide for the Plex devs to just automatically do this pruning as part of regular db maintenance, or just at the end of completed scans. Directories that contain no media parts and no subdirectories don’t serve any real purpose in the database, as far as I can tell.