mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #1677 from softworkz/SkipVirtualEpisodeRefresh
Restrict metadata refresh of missing/virtual episodes
This commit is contained in:
commit
8454639218
@ -255,7 +255,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
// Refresh current item
|
// Refresh current item
|
||||||
await RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
await RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
// Refresh TV
|
// Refresh seasons
|
||||||
foreach (var item in seasons)
|
foreach (var item in seasons)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
@ -268,12 +268,30 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
progress.Report(percent * 100);
|
progress.Report(percent * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh all non-songs
|
// Refresh episodes and other children
|
||||||
foreach (var item in otherItems)
|
foreach (var item in otherItems)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
var skipItem = false;
|
||||||
|
|
||||||
|
var episode = item as Episode;
|
||||||
|
|
||||||
|
if (episode != null
|
||||||
|
&& refreshOptions.MetadataRefreshMode != MetadataRefreshMode.FullRefresh
|
||||||
|
&& !refreshOptions.ReplaceAllMetadata
|
||||||
|
&& episode.IsMissingEpisode
|
||||||
|
&& episode.LocationType == Model.Entities.LocationType.Virtual
|
||||||
|
&& episode.PremiereDate.HasValue
|
||||||
|
&& (DateTime.UtcNow - episode.PremiereDate.Value).TotalDays > 30)
|
||||||
|
{
|
||||||
|
skipItem = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!skipItem)
|
||||||
|
{
|
||||||
await item.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
await item.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
numComplete++;
|
numComplete++;
|
||||||
double percent = numComplete;
|
double percent = numComplete;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user