Folder Watching (#1467)
* Hooked in a server setting to enable/disable folder watching * Validated the file rename change event * Validated delete file works * Tweaked some logic to determine if a change occurs on a folder or a file. * Added a note for an upcoming branch * Some minor changes in the loop that just shift where code runs. * Implemented ScanFolder api * Ensure we restart watchers when we modify a library folder. * Fixed a unit test
This commit is contained in:
parent
87ad5844f0
commit
037a1a5a8c
19 changed files with 269 additions and 102 deletions
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.IO;
|
||||
|
@ -511,7 +511,7 @@ namespace API.Services
|
|||
var fullPath = Path.Join(folder, parts.Last());
|
||||
if (!dirs.ContainsKey(fullPath))
|
||||
{
|
||||
dirs.Add(fullPath, string.Empty);
|
||||
dirs.Add(Parser.Parser.NormalizePath(fullPath), string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ namespace API.Services
|
|||
{
|
||||
try
|
||||
{
|
||||
return Parser.Parser.NormalizePath(Directory.GetParent(fileOrFolder).FullName);
|
||||
return Parser.Parser.NormalizePath(Directory.GetParent(fileOrFolder)?.FullName);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue