Don't analyze specials & query folder

This commit is contained in:
ConfusedPolarBear 2022-05-02 01:18:31 -05:00
parent 98f73c3dba
commit dad7d6dd72
2 changed files with 19 additions and 3 deletions

View File

@ -87,6 +87,7 @@ public class Entrypoint : IServerEntryPoint
// Get all items from this library. Since intros may change within a season, sort the items before adding them. // Get all items from this library. Since intros may change within a season, sort the items before adding them.
var folder = _userViewManager.GetUserViews(query)[0]; var folder = _userViewManager.GetUserViews(query)[0];
var items = folder.GetItems(new InternalItemsQuery() { var items = folder.GetItems(new InternalItemsQuery() {
ParentId = Guid.Parse(rawId),
OrderBy = new [] { ("SortName", SortOrder.Ascending) }, OrderBy = new [] { ("SortName", SortOrder.Ascending) },
IncludeItemTypes = new BaseItemKind[] { BaseItemKind.Episode }, IncludeItemTypes = new BaseItemKind[] { BaseItemKind.Episode },
Recursive = true, Recursive = true,
@ -159,6 +160,7 @@ public class Entrypoint : IServerEntryPoint
continue; continue;
} }
_logger.LogDebug("Accessing libraries as {Username}", user.Username);
return user.Id; return user.Id;
} }

View File

@ -75,8 +75,12 @@ public class FingerprinterTask : IScheduledTask {
foreach (var season in queue) { foreach (var season in queue) {
var first = season.Value[0]; var first = season.Value[0];
_logger.LogDebug( // Don't analyze seasons with <= 1 episode or specials
"Fingerprinting {Count} episodes from {Name} season {Season}", if (season.Value.Count <= 1 || first.SeasonNumber == 0)
{
continue;
}
season.Value.Count, season.Value.Count,
first.SeriesName, first.SeriesName,
first.SeasonNumber); first.SeasonNumber);
@ -89,6 +93,11 @@ public class FingerprinterTask : IScheduledTask {
for (var i = 0; i < episodes.Count; i += 2) for (var i = 0; i < episodes.Count; i += 2)
{ {
if (cancellationToken.IsCancellationRequested)
{
break;
}
var lhs = episodes[i]; var lhs = episodes[i];
var rhs = episodes[i+1]; var rhs = episodes[i+1];
@ -120,6 +129,11 @@ public class FingerprinterTask : IScheduledTask {
} }
Plugin.Instance!.Configuration.SaveTimestamps(); Plugin.Instance!.Configuration.SaveTimestamps();
if (cancellationToken.IsCancellationRequested)
{
break;
}
} }
return Task.CompletedTask; return Task.CompletedTask;
@ -249,7 +263,7 @@ public class FingerprinterTask : IScheduledTask {
Plugin.Instance!.Intros[episode] = new Intro() Plugin.Instance!.Intros[episode] = new Intro()
{ {
EpisodeId = episode, EpisodeId = episode,
Valid = (introStart > 0) && (introEnd > 0), Valid = introEnd > 0,
IntroStart = introStart, IntroStart = introStart,
IntroEnd = introEnd, IntroEnd = introEnd,
ShowSkipPromptAt = Math.Max(0, introStart - 5), ShowSkipPromptAt = Math.Max(0, introStart - 5),