mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
fixes #87 - Directory Watchers need to ignore thumbs.db
This commit is contained in:
parent
156639b9ec
commit
9a116a8575
@ -338,6 +338,13 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||
return;
|
||||
}
|
||||
|
||||
var nameFromFullPath = Path.GetFileName(e.FullPath);
|
||||
// Ignore certain files
|
||||
if (!string.IsNullOrEmpty(nameFromFullPath) && _alwaysIgnoreFiles.Contains(nameFromFullPath, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Ignore when someone manually creates a new folder
|
||||
if (e.ChangeType == WatcherChangeTypes.Created && name == "New folder")
|
||||
{
|
||||
@ -444,7 +451,15 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
//the file is unavailable because it is:
|
||||
//still being written to
|
||||
@ -453,6 +468,10 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||
Logger.Debug("{0} is locked.", path);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user