update library changed notifier
This commit is contained in:
@@ -1512,6 +1512,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
}
|
||||
}
|
||||
|
||||
DeleteFileIfEmpty(recordPath);
|
||||
|
||||
TriggerRefresh(recordPath);
|
||||
_libraryMonitor.ReportFileSystemChangeComplete(recordPath, false);
|
||||
|
||||
@@ -1542,6 +1544,23 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteFileIfEmpty(string path)
|
||||
{
|
||||
var file = _fileSystem.GetFileInfo(path);
|
||||
|
||||
if (file.Exists && file.Length == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
_fileSystem.DeleteFile(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting 0-byte failed recording file {0}", ex, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TriggerRefresh(string path)
|
||||
{
|
||||
_logger.Info("Triggering refresh on {0}", path);
|
||||
|
||||
@@ -1421,7 +1421,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
|
||||
if (newPrograms.Count > 0)
|
||||
{
|
||||
_libraryManager.CreateItems(newPrograms, cancellationToken);
|
||||
_libraryManager.CreateItems(newPrograms, null, cancellationToken);
|
||||
}
|
||||
|
||||
// TODO: Do this in bulk
|
||||
|
||||
Reference in New Issue
Block a user