-
Notifications
You must be signed in to change notification settings - Fork 139
Tell Plex to refresh only changed libraries #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This could probably be a little smarter, but for me, at least, it works better than refreshing everything every time.
Refreshing all files is generally not an issue (number of episode/movie files is always extremely limited due to filesize). It might make sense to if you have a huge number of small audio files, but audio is not really a primary feature, and disabled by default. Instead of updating all, you update "just" one class of media, which doesn't fix the problem. Just refreshing only the new files would be best, but that's not possible due potential discrepancies between the filebot host and the plex host (which might be two different computers). |
I disagree that it isn't an issue - my libraries have thousands of movies and thousands of episodes of TV shows, so it takes several minutes to rescan the entire library (even with "Run a partial scan when changes are detected" turned on in the 'Advanced' server settings in Plex). Limiting the refresh to only the part of the library that has changed cuts the refresh time in half for me. |
Is it IO-bound or CPU-bound? Why does it take unreasonably long? Checking timestamps on a few thousand files shouldn't take long. System calls are slow, but not that slow. |
If you figure out a way to specifically rescan a newly added folder, rather than the whole movie / series / music library then I'd be happy to merge it. |
I'm not sure if it's IO-bound or CPU-bound. Even with most of the filesystem metadata cached, Plex still takes two to three minutes for each of my TV and movie libraries. I don't think there's any way to get Plex to scan only a specific subfolder; I agree that would be ideal, but scanning the relevant library is still an improvement over "scan everything every time", isn't it? |
Scanning only 1/3 of a huge library is still scanning a huge library, especially if just one new file got added. Out of curiosity, have you tried listing newly added files using basic unix commands? How many seconds does |
The output from 'time find ${TV} ${MOVIES} -mtime -7' says:
Using my phone as a stopwatch, rescanning just my TV shows takes 2 minutes and 9 seconds. (I'm running Plex on FreeBSD, though, so it's possible there's some sort of platform-specific issue with rescanning large-ish libraries there?) |
20 seconds for find? That is more than I would have expected. It's basically the lower bound for figuring out which files have recently been added / modified. I would raise the issue in the Plex forums. At the very least there should be a way to update specific folders / files. Either via filebot, or just via find and passing the data along. |
It's actually about a quarter of a second for find, not twenty seconds. |
That's definitely really fast then! There's surely something that can be improved on the Plex side given that find takes fractions of a second to find recently added files. |
This could probably be a little smarter, but for me, at least, it works better than refreshing everything every time.