Skip to content

Conversation

clee
Copy link

@clee clee commented Nov 25, 2014

This could probably be a little smarter, but for me, at least, it works better than refreshing everything every time.

This could probably be a little smarter, but for me, at least,
it works better than refreshing everything every time.
@rednoah
Copy link
Member

rednoah commented Nov 25, 2014

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).

@rednoah rednoah closed this Nov 25, 2014
@clee
Copy link
Author

clee commented Nov 25, 2014

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.

@rednoah
Copy link
Member

rednoah commented Nov 25, 2014

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.

@rednoah
Copy link
Member

rednoah commented Nov 25, 2014

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.

@clee
Copy link
Author

clee commented Nov 25, 2014

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?

@rednoah
Copy link
Member

rednoah commented Nov 26, 2014

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?
time find /path/to/media -mtime -7
(list files/folders newer than 7 days)

How many seconds does find need to find all the recently added files? How much longer does Plex take for it's "rescan"?

@clee
Copy link
Author

clee commented Nov 26, 2014

The output from 'time find ${TV} ${MOVIES} -mtime -7' says:

    0.03s user 0.19s system 0% cpu 0.253 total

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?)

@rednoah
Copy link
Member

rednoah commented Nov 26, 2014

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.

@clee
Copy link
Author

clee commented Nov 26, 2014

It's actually about a quarter of a second for find, not twenty seconds.

@rednoah
Copy link
Member

rednoah commented Nov 26, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants