Skip to content
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

[ FEATURE ] Add timeout to Plex, etc. to prevent excessive scanning #206

Closed
OmgImAlexis opened this issue Mar 24, 2016 · 14 comments
Closed

Comments

@OmgImAlexis
Copy link
Collaborator

If you add a lot of files to process all at once Sickrage tells Plex, etc. to rescan the library after every single file this can in some cases cause Plex to be completely unusable. I'd suggest we add a 20 second timeout and if there's another file processed within that time it resets it, after the timeout hits 0 only then do we send the refresh command. This would cause Plex to only scan the library once instead of in my case 500 times in 60 seconds.

@labrys
Copy link
Contributor

labrys commented Mar 25, 2016

I think either the timeout should be configurable, or better yet only call it once at the end of postprocessing if results were found.

@fernandog
Copy link
Contributor

@OmgImAlexis its calls plex to refresh ONLY that show. To avoid scan full library

@OmgImAlexis
Copy link
Collaborator Author

@fernandog it may but Plex seems to rescan every single show. You sure it's not a quick scan of the show's library? Every single file that was processed when I was running it I had the whole "TV Show" library rescan.

Even if it's just the one show that's still not the best idea since you could be processing a lot of files for the same show like when I added Pokemon and it processed 400+ files at once, there's no need to rescan the show 400+ times when once after they've all been added would be fine.

@labrys
Copy link
Contributor

labrys commented Mar 25, 2016

@OmgImAlexis as far as i'm aware it refreshes the entire library.

@labrys
Copy link
Contributor

labrys commented Feb 8, 2017

@p0psicles another candidate for the Throttle class ... limit calls to refresh plex to, for example, once an hour

@OmgImAlexis
Copy link
Collaborator Author

Once an hour doesn't really help at all since Plex itself can have an option to do it once an hour. Doing it per show would be a lot better.

@ripper1967
Copy link

ripper1967 commented Feb 8, 2017 via email

@OmgImAlexis
Copy link
Collaborator Author

@ripper1967 I know that and that's why I'd like to have something that just updates a single show. There's no point in Plex rescanning 10k+ episodes just to see that a single show with for example 2 episodes has a new one.

@ripper1967
Copy link

ripper1967 commented Feb 8, 2017 via email

@OmgImAlexis
Copy link
Collaborator Author

That auto scan just watches the file system and then updates. That doesn't work if you're using a network drive, if you're using docker and some OSs don't allow it either.

@Thraxis
Copy link
Contributor

Thraxis commented Feb 8, 2017

Unfortunately Plex doesn't have any method to say "update that show" You can either tell it "Look for any new items and add those" or "Refresh the Metadata for every item in library 'X'"

My system runs a complete library update check of the TV section of my Plex library in 1 minute 20 seconds. Which contains 286 different shows, spanning 733 seasons with 10749 episodes.

An update check on the Anime section of my Plex library takes about 40 seconds. That is for 215 shows, spanning 317 seasons and 5025 episodes.

To scan both libraries would take about 2 minutes, I'd say a buffered call to plex where it would send one request every 5 minutes, consuming any duplicate requests between calls would be about the best you could do.

@labrys
Copy link
Contributor

labrys commented Feb 8, 2017

@OmgImAlexis Plex doesnt allow update of just a single series, only a single library. And as for the update once per hour in plex, that will trigger every hour regardless of changes. Using the example I mentioned it would only trigger a refresh once per hour if you had new shows during that time. If you go 3 hours without a new episode added, it wouldnt trigger a scan. It would be great if Plex supported scanning for just a single series/path.

@OmgImAlexis
Copy link
Collaborator Author

@Thraxis there is a update only this show but it needs to be done from the cli. Maybe we could look into adding a simple plex channel that just exposes the refresh function that we can then call?
On my setup a refresh to my show library with over 13k episodes takes well over 5 minutes and when multiple refreshes are done it can actually end up taking over half an hour for new episodes to appear as it seems to queue the refreshes one after each other or something like that.

@labrys that would help a little but still the single show would be ideal.

Maybe we can see if Plex would be willing to add another API endpoint for single show refreshes? I've had them respond quite nicely to other requests for bugs and such.

@labrys
Copy link
Contributor

labrys commented May 3, 2017

Added to master feature request list - discussion for feature will continue here even though issue is closed.

@labrys labrys closed this as completed May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants