mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
fix scan stopping and restarting itself multiple times when adding/removing collections
This commit is contained in:
@@ -358,39 +358,36 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||
|
||||
var tempIgnorePaths = _tempIgnoredPaths.Keys.ToList();
|
||||
|
||||
if (e.ChangeType == WatcherChangeTypes.Changed)
|
||||
// If the parent of an ignored path has a change event, ignore that too
|
||||
if (tempIgnorePaths.Any(i =>
|
||||
{
|
||||
// If the parent of an ignored path has a change event, ignore that too
|
||||
if (tempIgnorePaths.Any(i =>
|
||||
if (string.Equals(i, e.FullPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.Equals(i, e.FullPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Go up a level
|
||||
var parent = Path.GetDirectoryName(i);
|
||||
// Go up a level
|
||||
var parent = Path.GetDirectoryName(i);
|
||||
if (string.Equals(parent, e.FullPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Go up another level
|
||||
if (!string.IsNullOrEmpty(parent))
|
||||
{
|
||||
parent = Path.GetDirectoryName(i);
|
||||
if (string.Equals(parent, e.FullPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Go up another level
|
||||
if (!string.IsNullOrEmpty(parent))
|
||||
{
|
||||
parent = Path.GetDirectoryName(i);
|
||||
if (string.Equals(parent, e.FullPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tempIgnorePaths.Contains(e.FullPath, StringComparer.OrdinalIgnoreCase))
|
||||
|
||||
@@ -1430,10 +1430,22 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
.OfType<CollectionFolder>()
|
||||
.Where(i =>
|
||||
{
|
||||
var locationType = i.LocationType;
|
||||
|
||||
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return i.LocationType != LocationType.Remote && i.LocationType != LocationType.Virtual &&
|
||||
i.ResolveArgs.PhysicalLocations.Contains(item.Path);
|
||||
|
||||
return i.ResolveArgs.PhysicalLocations.Contains(item.Path);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user