Re-establish link to media without having to rescan/analyze

Hi, i am running PMS on a Synology ds916+
I have my library within googledrive encrypted and bring this down through a mix of either plexdrive and/or rclone (with cache).

On occasion, rclone/plexdrive disconnects and it does this during heavy load (eg scanning library). Whilst plexdrive/rclone does remount the volume, by this time PMS has marked library items with the red trashcan and unavailable.

In order to remove the red trash can and make the media available again, i need to do a “Scan Library Files”. As such this does a lot of processing / analyzing of content which has been previously analyzed.

Is there a way of removing the “unavailable” / “red trash can” from items without having to do a complete rescan and analyze but pick up the existing analyzed information?

Thanks

if I’m not strongly mistaken, you don’t need to re-scan your library…if I remember correctly, accessing the library item once the drive is available again should do the job… if not that, you could “analyze” the item (asking Plex to validate the file content for its tracks, length, size…).

make sure you don’ t tell your library to automatically delete items it cannot find – with this kind of touchy connection, you’ll otherwise end up losing content from your database.

Thanks very much for the response, when you say “accessing the library item once the drive is available again should do the job” are you implying that all i need to do is “play” the item?

When going to the item to play, there is no play item, its only the red trashcan (where the play button normally is) and when hovering over it, the trashcan disappears, but no play icon appears. clicking on it is not making it start either.


and yes i do not have Empty Trash enabled. so any “unavailable content” remains in the library

no… depending on your server configuration, Plex will verify if a file is still unavailable by simply going to the movie’s pre-play screen – either it no longer does this or I got this wrong.
can you try clicking ... > Analyze for this movie?

What you have going on is actually 2 different things. “Unavailable” happens when the file is not found when ever it is accessed. This will go away on it’s own when the file is discovered. The trashcan only occurs if Plex scans your library. If this is showing up on it’s own you probably have the option set to “Update my library automatically” or “Update my library periodically”. The only way to remove the trashcan is to do another scan.

@“MovieFan.Plex” said:
What you have going on is actually 2 different things. “Unavailable” happens when the file is not found when ever it is accessed. This will go away on it’s own when the file is discovered. The trashcan only occurs if Plex scans your library. If this is showing up on it’s own you probably have the option set to “Update my library automatically” or “Update my library periodically”. The only way to remove the trashcan is to do another scan.

Thank you - yes it has become “unavailable” due to the mount disappearing whilst the scan has happened. YEs i have Update my Library automatically and Update my library periodically" set. I am unaware of any other way (apart from manually scanning) to update the library if i dont have this enabled.

@tom80H said:

can you try clicking ... > Analyze for this movie?

no clicking analyze doesnt remove the red trash can

Would be helpful to know more about your setup. I’m assuming your using either unionfs or mergerfs (x100 better beeteedubs) to fuse local/remote mounts. Are you fusing plexdrive, rclone, both? What happens if you just try to play a red file? Also, can’t remember what the SQL commands are but try dumping the # of files needing analysis / deep analysis along with the # of “trashed” files

@zmike808 said:
Would be helpful to know more about your setup. I’m assuming your using either unionfs or mergerfs (x100 better beeteedubs) to fuse local/remote mounts. Are you fusing plexdrive, rclone, both? What happens if you just try to play a red file? Also, can’t remember what the SQL commands are but try dumping the # of files needing analysis / deep analysis along with the # of “trashed” files

mounting encrypted gdrive through plexdrive, and decrypting via a local rclone remote.
and (on another box)
mounting gdrive through rclone.

both are using fuse to mount.

playing files is not a problem if the mount is up, its purely when the mount fails, through a scan and having the ability to remove the trashcan once the mount is restored, without having the rescan the whole library

Yes, but the fact that the mount is up and you can’t re-find the files is a deeper issue imo. The main box is having this issue or both? If you weren’t using rclone crypt I’d say switch to plexdrive asap and don’t look back until rclone actually uses the same caching mechanism as plexdrive for they’re gdrive code… Speaking of which, are you mounting gdrive wrapped in cache remote for rclone or no?
Sorry, got a little off topic. I don’t know if your flow is you add new media to the machine running plex, but if it is, you should just enable auto scan/partial folder refreshing so this would never happen. I’m betting that currently you are using a timed library full refresh?

Edit: This script by ajkis https://github.com/ajkis/scripts/blob/master/plex/plex-library-stats.sh is what I was mentioning before with the sqliteDB queries. It is really quiet useful. Especially if you tweak it a bit so you can see what files were actually deleted/which need modifying etc… However, for your purposes the stock version should be fine since it’ll just spit out a total #

Edit2: Sorry, re-read your post and realized you said:

@DRPhoto said:

both are using fuse to mount.
By fuse, do you mean you literally mount each remote to its own folder, without any unionfs/mergerfs overlay merging them? If so, which one is plex actually pointing to?

@zmike808 said:
Yes, but the fact that the mount is up and you can’t re-find the files is a deeper issue imo.
i can read them once i do a rescan, but it wont refind them automatically.

@zmike808 said:
The main box is having this issue or both? If you weren’t using rclone crypt I’d say switch to plexdrive asap and don’t look back until rclone actually uses the same caching mechanism as plexdrive for they’re gdrive code… Speaking of which, are you mounting gdrive wrapped in cache remote for rclone or no?

Yup thanks - i use rclone with crypt and cache (v1.39), i also use rclone 1.38 with crypt and also plexdrive on a different server.
rew fuse: yes - a single rclone remote.
ultimately the library is presented, unencrypted to a local mount point - to which PMS is pointed to. (/mnt/gdrive.de/TV or Movies)

im not to worried about my rclone/plexdrive setup as its being responsive and working correctly (albeit unmounting randomly), but it appears to be (on a user experience level), PMS not checking to see if “unavailable media” is available once its been marked as unavailable unless you do a scan

@DRPhoto said:
Thank you - yes it has become “unavailable” due to the mount disappearing whilst the scan has happened. YEs i have Update my Library automatically and Update my library periodically" set. I am unaware of any other way (apart from manually scanning) to update the library if i dont have this enabled.
“Update my Library automatically” and “Update my library periodically” scan the entire folder that your library is pointed to. Don’t use this option. If you don’t want Plex to identify these files when the mount is removed, use “Run a partial scan when changes are detected” instead.

Ok thank you - i will do.

@“MovieFan.Plex” said:

@DRPhoto said:
Thank you - yes it has become “unavailable” due to the mount disappearing whilst the scan has happened. YEs i have Update my Library automatically and Update my library periodically" set. I am unaware of any other way (apart from manually scanning) to update the library if i dont have this enabled.
“Update my Library automatically” and “Update my library periodically” scan the entire folder that your library is pointed to. Don’t use this option. If you don’t want Plex to identify these files when the mount is removed, use “Run a partial scan when changes are detected” instead.

i did mark this as resolved, which had worked, however i have just lost my mount, and there are movies which have the red trashcan over the top of them. This in part works, but does not work foolproof each time.

i have confirmed i have only “Run a partial scan when changes are detected” selected. Hoping for additional help

Something with the way the drive mounts work is causing Plex to still try to scan those folders even when the mount isn’t available. Please note that PMS does not officially support using mounted cloud drives. Your results are YMMV.

The only other thing I can suggest at this point is to turn off that “Run a partial scan when changes are detected” setting too and only run a scan manually when you know the mount is working.