Minor LibraryMonitor improvements

* Enable nullable
* Add a fast return to ReportFileSystemChanged when path should be ignored
* Use Span overloads of Path.* functions where possible
* IFileSystem: remove NormalizePath as Path.TrimEndingDirectorySeparator already checks if it's a root path
This commit is contained in:
Bond_009
2023-09-13 17:30:50 +02:00
parent 3f19befc59
commit 767a42fbdb
8 changed files with 44 additions and 75 deletions

View File

@@ -85,7 +85,7 @@ namespace Emby.Server.Implementations.IO
}
}
public void ResetPath(string path, string affectedFile)
public void ResetPath(string path, string? affectedFile)
{
lock (_timerLock)
{
@@ -148,13 +148,6 @@ namespace Emby.Server.Implementations.IO
{
item.ChangedExternally();
}
catch (IOException ex)
{
// For now swallow and log.
// Research item: If an IOException occurs, the item may be in a disconnected state (media unavailable)
// Should we remove it from it's parent?
_logger.LogError(ex, "Error refreshing {Name}", item.Name);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error refreshing {Name}", item.Name);