The machine I run Plex on has multiple NAS boxes that it mounts as storage. If one of these NAS boxes loses network connection (say it takes updates and restarts) this can cause Plex to scan, detect all the content on that NAS as missing, and then empty the trash. When it mounts the NAS again, it then rediscovers all that content which can take a lot of time depending on amount of content and metadata generation, which can cause unavailability to users (bad). Conversely, if I disable emptying trash on scan or disable running a partial scan when changes are detected, then addition/removal of individual files isn’t reflected in a timely way in the libraries (also bad).
I would like a way for partial scanning and emptying trash after scan to work as they do today, but only in the event that storage for that library is still connected (e.g. Plex can access the root library mount address under which the file-to-be-emptied-from-trash was located).
Plex will already do that and not delete items if it determines they’re on a drive that’s been entirely offline.
For reference: completely disconnect an external or network drive which contains media files, then trigger a scan. Plex should list the items from that drive as unavailable but not delete them.
The more troublesome cases are with drives that aren’t fully disconnected/offline but simply too slow to react or spin up. In that case Plex won’t determine that drive to be offline and trash items which it couldn’t detect during the scan.
I just encountered this again and this response isn’t consistent with what I’m seeing. I have Plex running on Windows and library root directories are UNC paths to pools shared via SMB on a separate machine running TrueNAS. If I shut down the TrueNAS server without shutting down Plex first, Plex will remove from all libraries any files stored on that TrueNAS server, not just mark them as unavailable.
Are the media files directly in the (root of the) file shares, or did you point the Plex libraries to a folder in those file shares?
This might be a crucial difference.
The UNC path that Plex has as a source for its Movies library is of the form:
\\SERVERNAME\ShareName\Movies
So ShareName is the SMB share from the TrueNAS server named SERVERNAME. And then within that top-level SMB share is a folder called Movies which is what is added as a source to the library in Plex.
For my use case, not emptying trash automatically is actually significantly more annoying on an ongoing basis than occasionally having to re-discover things, as I don’t have any manual work I need to do within Plex in order for a subsequent scan to get all the metadata back the way it was.