mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
reduce rescanning due to IsOffline
This commit is contained in:
@@ -281,6 +281,20 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public Task UpdateIsOffline(bool newValue)
|
||||
{
|
||||
var item = this;
|
||||
|
||||
if (item.IsOffline != newValue)
|
||||
{
|
||||
item.IsOffline = newValue;
|
||||
// this is creating too many repeated db updates
|
||||
//return item.UpdateToRepository(ItemUpdateType.None, CancellationToken.None);
|
||||
}
|
||||
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the location.
|
||||
/// </summary>
|
||||
@@ -290,10 +304,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsOffline)
|
||||
{
|
||||
return LocationType.Offline;
|
||||
}
|
||||
//if (IsOffline)
|
||||
//{
|
||||
// return LocationType.Offline;
|
||||
//}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Path))
|
||||
{
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (currentChildren.TryGetValue(child.Id, out currentChild) && IsValidFromResolver(currentChild, child))
|
||||
{
|
||||
await UpdateIsOffline(currentChild, false).ConfigureAwait(false);
|
||||
await currentChild.UpdateIsOffline(false).ConfigureAwait(false);
|
||||
validChildren.Add(currentChild);
|
||||
|
||||
continue;
|
||||
@@ -404,7 +404,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
else if (!string.IsNullOrEmpty(item.Path) && IsPathOffline(item.Path))
|
||||
{
|
||||
await UpdateIsOffline(item, true).ConfigureAwait(false);
|
||||
await item.UpdateIsOffline(true).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -461,17 +461,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
progress.Report(100);
|
||||
}
|
||||
|
||||
private Task UpdateIsOffline(BaseItem item, bool newValue)
|
||||
{
|
||||
if (item.IsOffline != newValue)
|
||||
{
|
||||
item.IsOffline = newValue;
|
||||
return item.UpdateToRepository(ItemUpdateType.None, CancellationToken.None);
|
||||
}
|
||||
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
private async Task RefreshMetadataRecursive(MetadataRefreshOptions refreshOptions, bool recursive, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var children = ActualChildren.ToList();
|
||||
|
||||
@@ -134,5 +134,6 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
Task UpdateEncoderPath(string path, string pathType);
|
||||
bool SupportsEncoder(string encoder);
|
||||
bool IsDefaultEncoderPath { get; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user