Jump to content

Scan Media Library: What exactly should this task be doing?


cnstarz

Recommended Posts

cnstarz

I have this task set to run every 15 minutes.  However, it's been taking far longer to scan my TV Library -- this has been happening for a few months now.  It used to take less than 5 minutes.  To troubleshoot why it's taking so long, I followed the logs during the scan and it seems like it's downloading metadata for every single episode in my library.  Is that supposed to happen?  I assumed this task would look for new media files and only pull metadata for any new movies or shows that it was able to detect.

Edited by cnstarz
Link to comment
Share on other sites

Happy2Play
4 minutes ago, cnstarz said:

I have this task set to run every 15 minutes.  However, it's been taking far longer to scan my TV Library -- this has been happening for a few months now.  It used to take less than 5 minutes.  To troubleshoot why it's taking so long, I followed the logs during the scan and it seems like it's pulling metadata for every single episode in my library.  Is that supposed to happen?  I assumed this task would look for new media files and only pull metadata for any new movies or shows that it was able to detect.

Cached metadata expires so Emby will get from providers again.  And depending on library setting it will get an entire series in one shot from TVDB but TMDB will be per episode.

But normally yes the scan will only look for new/changed.

Link to comment
Share on other sites

cnstarz
17 minutes ago, Happy2Play said:

Cached metadata expires so Emby will get from providers again.  And depending on library setting it will get an entire series in one shot from TVDB but TMDB will be per episode.

But normally yes the scan will only look for new/changed.

Thank you.  Do you know how long cached metadata is good before expiring?  This library has TVDB as #1 for "Series Metadata Downloaders" and "Episode Metadata Downloaders"; TVDB isn't listed for "Season Metadata Downloaders"

 

12 minutes ago, Luke said:

Hi there, let's look at an example of a scan that you think took too long:

Thanks.

I'm gonna enable debug logging, reboot the server, then start a scan of my TV library.  I'll upload the log in about 20 mins if the scan isn't finished by then.

Link to comment
Share on other sites

cnstarz
Posted (edited)
36 minutes ago, Luke said:

Hi there, let's look at an example of a scan that you think took too long:

Thanks.

Here are the attached logs.  The only actions I did after restarting the server was initiate a Media Scan of my TV library.  The last time any new media was added to the TV library was about 2 hours ago.  Again, I have the "Scan Media Library" task scheduled to run every 15 minutes.

embyserver-63845505458.txt hardware_detection-63845504046.txt

Edited by cnstarz
Link to comment
Share on other sites

You configured an automatic refresh interval on the library. That's why it is refreshing things that have been scanned before. It's doing exactly what you told it to do.

Link to comment
Share on other sites

cnstarz
2 minutes ago, Luke said:

You configured an automatic refresh interval on the library. That's why it is refreshing things that have been scanned before. It's doing exactly what you told it to do.

That's what I'm trying to get at, is what exactly the "Scan Media Library" task does.  Does it actually refresh everything, including things that haven't changed or been added?  The description of the task says "Scans your media library to check for new and updated files." which implies it shouldn't be refreshing anything unless something has changed or has been added.

Link to comment
Share on other sites

Quote

Does it actually refresh everything, including things that haven't changed or been added? 

If you configure the automatic refresh interval, then this is handled during the library scan, so yes, it can impact your scan times.

If you don't have that enabled then it is only looking for new and updated files.

Link to comment
Share on other sites

cnstarz
1 minute ago, Luke said:

If you configure the automatic refresh interval, then this is handled during the library scan, so yes, it can impact your scan times.

If you don't have that enabled then it is only looking for new and updated files.

I should clarify that I disabled the scheduled task before I restarted the server because I didn't want it to possibly interfere with the manual task that I was gonna start.

Link to comment
Share on other sites

cnstarz
9 minutes ago, Luke said:

If you configure the automatic refresh interval, then this is handled during the library scan, so yes, it can impact your scan times.

If you don't have that enabled then it is only looking for new and updated files.

So, if you manually start a "Scan Library Files" for just a specific library, then it only looks for new and updated files, but if a scheduled "Scan Media Library" task runs then it actually refreshes everything (even things that aren't new or updated)?  Am I understanding that correctly?

Link to comment
Share on other sites

7 minutes ago, cnstarz said:

So, if you manually start a "Scan Library Files" for just a specific library, then it only looks for new and updated files, but if a scheduled "Scan Media Library" task runs then it actually refreshes everything (even things that aren't new or updated)?  Am I understanding that correctly?

No, they both act the same way. The former just scans a single library while the latter scans everything.

Link to comment
Share on other sites

pünktchen
1 hour ago, cnstarz said:

That's what I'm trying to get at, is what exactly the "Scan Media Library" task does.  Does it actually refresh everything, including things that haven't changed or been added?  The description of the task says "Scans your media library to check for new and updated files." which implies it shouldn't be refreshing anything unless something has changed or has been added.

I'm not sure you've understood what Luke is telling you. He is not only talking about the Scan Media Library task, but your library settings that come into play:

image.png.f6ab1a0ef06cf40e4d67e98787df23fd.png

  • Agree 1
Link to comment
Share on other sites

cnstarz
Posted (edited)
26 minutes ago, pünktchen said:

I'm not sure you've understood what Luke is telling you. He is not only talking about the Scan Media Library task, but your library settings that come into play:

image.png.f6ab1a0ef06cf40e4d67e98787df23fd.png

Ohhhhh, okay, his comment makes more sense now, but I'm not convinced that's what going on here. 

I guess my next question is: does that setting refresh all metadata on that entire library every 30 days from the day the Library was initially imported, or does it refresh only individual items in that library every 30 days from the date that each item was added to emby?  Whichever way it does it, I'm not sure it explains why my Library scan is taking over 20 minutes (as opposed to 1-2 minutes) and is downloading fresh data for every episode, every single time it does a Library scan (which was configured for every 15 minutes).

Is there a way to see the last time an episode's metadata was refreshed, or see how old an episode's metadata is, or when it was downloaded?

Edited by cnstarz
Link to comment
Share on other sites

8 minutes ago, cnstarz said:

 

I guess my next question is: does that setting refresh all metadata on that entire library every 30 days from the day the Library was initially imported, or does it refresh only individual items in that library every 30 days from the date that each item was added to emby?  Whichever way it does it, I'm not sure it explains why my Library scan is taking over 20 minutes (as opposed to 1-2 minutes) and is downloading fresh data for every episode, every single time it does a Library scan (which was configured for every 15 minutes).

Is there a way to see the last time an episode's metadata was refreshed, or see how old an episode's metadata is, or when it was downloaded?

It is

 

9 minutes ago, cnstarz said:

Ohhhhh, okay, his comment makes more sense now, but I'm not convinced that's what going on here. 

I guess my next question is: does that setting refresh all metadata on that entire library every 30 days from the day the Library was initially imported, or does it refresh only individual items in that library every 30 days from the date that each item was added to emby?  Whichever way it does it, I'm not sure it explains why my Library scan is taking over 20 minutes (as opposed to 1-2 minutes) and is downloading fresh data for every episode, every single time it does a Library scan (which was configured for every 15 minutes).

Is there a way to see the last time an episode's metadata was refreshed, or see how old an episode's metadata is, or when it was downloaded?

for each individual item. So for example if you refresh an individual episode manually, then that resets the date last refreshed for that one episode.

There is currently no way to see this value.

Link to comment
Share on other sites

cnstarz

Okay, I set that refresh metadata interval to "never", rebooted the server, initiated a Scan for my TV library, and it's still re-downloading metadata for all of my episodes.

Link to comment
Share on other sites

cnstarz

@LukeI'm noticing that during every Library scan for any of my libraries, either MovieNfoProvider or EpisodeNfoProvider reports a change to every single one of my media files, resulting in `Running MovieNfoProvider`, `Running MovieDbProvider`, `Running OmdbItemProvider`, `Running TvdbMovieProvider`, and `Saving nfo metadata` for every single media file, even though nothing has changed for any of my media files.  Here's a snippet of the output I'm talking about:

 

2024-03-08 19:24:33.158 Debug App: MovieNfoProvider reports change to 568661 - /mnt/media/movies/Emancipation (2022) [imdb-tt12530246]/Emancipation (2022) [EAC3 Atmos 5.1][h264].mkv
2024-03-08 19:24:33.158 Debug App: Running MovieNfoProvider for /mnt/media/movies/Emancipation (2022) [imdb-tt12530246]/Emancipation (2022) [EAC3 Atmos 5.1][h264].mkv
2024-03-08 19:24:33.162 Debug App: Running MovieDbProvider for /mnt/media/movies/Emancipation (2022) [imdb-tt12530246]/Emancipation (2022) [EAC3 Atmos 5.1][h264].mkv
2024-03-08 19:24:33.164 Debug App: Running OmdbItemProvider for /mnt/media/movies/Emancipation (2022) [imdb-tt12530246]/Emancipation (2022) [EAC3 Atmos 5.1][h264].mkv
2024-03-08 19:24:33.165 Debug App: Running TvdbMovieProvider for /mnt/media/movies/Emancipation (2022) [imdb-tt12530246]/Emancipation (2022) [EAC3 Atmos 5.1][h264].mkv
2024-03-08 19:24:33.818 Debug App: Saving nfo metadata for /mnt/media/movies/Emancipation (2022) [imdb-tt12530246]/Emancipation (2022) [EAC3 Atmos 5.1][h264].mkv to /mnt/media/movies/Emancipation (2022) [imdb-tt12530246]/Emancipation (2022) [EAC3 Atmos 5.1][h264].nfo.
2024-03-08 19:24:33.825 Debug App: MovieNfoProvider reports change to 568662 - /mnt/media/movies/Falling Down (1993) [imdb-tt0106856]/Falling Down (1993) [AC3 2.0][x264].mkv
2024-03-08 19:24:33.825 Debug App: Running MovieNfoProvider for /mnt/media/movies/Falling Down (1993) [imdb-tt0106856]/Falling Down (1993) [AC3 2.0][x264].mkv
2024-03-08 19:24:33.827 Debug App: Running MovieDbProvider for /mnt/media/movies/Falling Down (1993) [imdb-tt0106856]/Falling Down (1993) [AC3 2.0][x264].mkv
2024-03-08 19:24:33.831 Debug App: Running OmdbItemProvider for /mnt/media/movies/Falling Down (1993) [imdb-tt0106856]/Falling Down (1993) [AC3 2.0][x264].mkv
2024-03-08 19:24:33.831 Debug App: Running TvdbMovieProvider for /mnt/media/movies/Falling Down (1993) [imdb-tt0106856]/Falling Down (1993) [AC3 2.0][x264].mkv
2024-03-08 19:24:34.843 Debug App: Saving nfo metadata for /mnt/media/movies/Falling Down (1993) [imdb-tt0106856]/Falling Down (1993) [AC3 2.0][x264].mkv to /mnt/media/movies/Falling Down (1993) [imdb-tt0106856]/Falling Down (1993) [AC3 2.0][x264].nfo.
2024-03-08 19:24:34.849 Debug App: MovieNfoProvider reports change to 568663 - /mnt/media/movies/Titanic (1997) [imdb-tt0120338]/Titanic (1997) [DTS 5.1][x264].mkv
2024-03-08 19:24:34.849 Debug App: Running MovieNfoProvider for /mnt/media/movies/Titanic (1997) [imdb-tt0120338]/Titanic (1997) [DTS 5.1][x264].mkv
2024-03-08 19:24:34.854 Debug App: Running MovieDbProvider for /mnt/media/movies/Titanic (1997) [imdb-tt0120338]/Titanic (1997) [DTS 5.1][x264].mkv
2024-03-08 19:24:34.861 Debug App: Running OmdbItemProvider for /mnt/media/movies/Titanic (1997) [imdb-tt0120338]/Titanic (1997) [DTS 5.1][x264].mkv
2024-03-08 19:24:34.862 Debug App: Running TvdbMovieProvider for /mnt/media/movies/Titanic (1997) [imdb-tt0120338]/Titanic (1997) [DTS 5.1][x264].mkv
2024-03-08 19:24:37.118 Debug App: Saving nfo metadata for /mnt/media/movies/Titanic (1997) [imdb-tt0120338]/Titanic (1997) [DTS 5.1][x264].mkv to /mnt/media/movies/Titanic (1997) [imdb-tt0120338]/Titanic (1997) [DTS 5.1][x264].nfo.
2024-03-08 19:24:37.125 Debug App: MovieNfoProvider reports change to 568664 - /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.125 Debug App: Running MovieNfoProvider for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.127 Debug App: Running MovieDbProvider for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.128 Debug App: Running OmdbItemProvider for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.128 Debug App: Running TvdbMovieProvider for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.128 Info HttpClient: GET https://api4.thetvdb.com/v4/search?type=movie&q=tt21198156&remote_id=tt21198156
2024-03-08 19:24:37.215 Info HttpClient: GET https://api4.thetvdb.com/v4/search?type=movie&q=993729&remote_id=993729
2024-03-08 19:24:37.363 Info HttpClient: GET https://api4.thetvdb.com/v4/search?type=movie&q=South Park the Streaming Wars Part 2&year=2022
2024-03-08 19:24:37.519 Debug App: TvdbMovieProvider returned no metadata for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.520 Debug App: Running FanartMovieImageProvider for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.520 Debug App: Running TvdbMovieImageProvider for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv
2024-03-08 19:24:37.710 Debug App: Saving nfo metadata for /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].mkv to /mnt/media/movies/South Park the Streaming Wars Part 2 (2022) [imdb-tt21198156]/South Park the Streaming Wars Part 2 (2022) [EAC3 5.1][h264].nfo.

 

Even though literally no changes have occurred to any of those .mkvs since the library was last scanned 20 mins ago, MovieNFOProvider still reports changes to those files.  Is this expected behavior?
 

Link to comment
Share on other sites

Happy2Play

No but need full log.

image.png.14f7d426e2313bfe670408793403bf80.png

Link to comment
Share on other sites

Happy2Play
3 minutes ago, cnstarz said:

Full log included in this comment.

But that will not apply to your current scan as that identified you had told Emby to update every 30 days.

But at the same time the scan still could be from that.  Or since you have scan set at 15 minute interval you could have a queue a mile long waiting to processes.

Link to comment
Share on other sites

cnstarz
Just now, Happy2Play said:

But that will not apply to your current scan as that identified you had told Emby to update every 30 days.

But at the same time the scan still could be from that.  Or since you have scan set at 15 minute interval you could have a queue a mile long waiting to processes.

I can initiate another scan and give you another log, but I'm telling you, it will have the same exact information.  Since I disabled the metadata refresh interval and deleted that 15-minute library scan interval, I've tried this at least 5 or 6 different times this evening on my TV and Movie libraries.  It does the same thing every time:  MovieNfoProvider or EpisodeNfoProvider reports a change to every single one of my media files.

Link to comment
Share on other sites

cnstarz
6 minutes ago, Happy2Play said:

But that will not apply to your current scan as that identified you had told Emby to update every 30 days.

But at the same time the scan still could be from that.  Or since you have scan set at 15 minute interval you could have a queue a mile long waiting to processes.

Here's a log of a Library Scan of my Movies library that I initiated immediately after a reboot of the server about 2 hours ago.  Metadata refreshing was turned off and the Library scan scheduled task was deleted.  This library scan took about 45 minutes to complete.

embyserver-63845522356.txt

Link to comment
Share on other sites

5 minutes ago, cnstarz said:

Here's a log of a Library Scan of my Movies library that I initiated immediately after a reboot of the server about 2 hours ago.  Metadata refreshing was turned off and the Library scan scheduled task was deleted.  This library scan took about 45 minutes to complete.

embyserver-63845522356.txt 5.23 MB · 0 downloads

A whole bunch of nfo files have changed, so the server is just reacting to that.

Link to comment
Share on other sites

cnstarz
Posted (edited)
4 minutes ago, Luke said:

A whole bunch of nfo files have changed, so the server is just reacting to that.

Emby is the only thing modifying nfo files.  It just finished modifying all of them about an hour prior to that because it was doing another Library scan.  How do I get Emby to stop reacting to changes that it made itself during a previous Library scan?  It's like a snake eating its own tail.

Edited by cnstarz
Link to comment
Share on other sites

cnstarz

Whelp, I don't know what happened or changed, but for some mysterious reason -- 4 hours later -- the scheduled library media scan now only takes about 45 seconds.  When I went to bed, scans were taking over 45 minutes.  When I woke up, they were taking only 45 seconds.  The server didn't restart at all during that time.  Thanks, computers.  🤷

Link to comment
Share on other sites

jaycedk

Guess it had a backlog of things to scan.

Thats done and its back to normal operation 😉

  • Agree 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...