aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-11-25 23:51:37 -0500
committerGitHub <noreply@github.com>2017-11-25 23:51:37 -0500
commitacc17634a4cf5b8bff4fec6e7334f814fad78eb0 (patch)
tree511a1914fea9b4ff9fc724539033023e5c1e04f6 /Emby.Server.Implementations/LiveTv
parent93cbaaec666ff0867f29d613f0a13dbb26888e52 (diff)
parent58a7829ecd773dbc3c875d3f0d4438b847fd54b5 (diff)
Merge pull request #3039 from MediaBrowser/dev
Dev
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