aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-11-25 23:48:12 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-11-25 23:48:12 -0500
commit58a7829ecd773dbc3c875d3f0d4438b847fd54b5 (patch)
tree511a1914fea9b4ff9fc724539033023e5c1e04f6 /Emby.Server.Implementations/LiveTv
parent4f09c1e06dab7cc8b260129648f5a54c77b8a4f9 (diff)
update library changed notifier
Diffstat (limited to 'Emby.Server.Implementations/LiveTv')
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs19
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs2
2 files changed, 20 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index a4c5645e74..35d2d3c0ab 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -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);
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index 7e72d1b1a1..7e27877e7c 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -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