aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-09-15 23:33:30 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-09-15 23:33:30 -0400
commita35f62a4a4fb8281c9eb660b16d836a15248a0bf (patch)
tree1ddf09a9e81be2b3ca78d0a2303bc998540f980c /MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
parentcbbc7269fa8b62af60f199cb0c69a6b10d0b5b54 (diff)
fixes #295 - Add play to vlc option
Diffstat (limited to 'MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs27
1 files changed, 17 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs b/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
index 39f747e0a..f5b5db3fd 100644
--- a/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
+++ b/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
@@ -266,21 +266,28 @@ namespace MediaBrowser.Server.Implementations.Channels
private bool IsSizeLimitReached(string path, double gbLimit)
{
- var byteLimit = gbLimit*1000000000;
-
- long total = 0;
-
- foreach (var file in new DirectoryInfo(path).EnumerateFiles("*", SearchOption.AllDirectories))
+ try
{
- total += file.Length;
+ var byteLimit = gbLimit * 1000000000;
- if (total >= byteLimit)
+ long total = 0;
+
+ foreach (var file in new DirectoryInfo(path).EnumerateFiles("*", SearchOption.AllDirectories))
{
- return true;
+ total += file.Length;
+
+ if (total >= byteLimit)
+ {
+ return true;
+ }
}
- }
- return false;
+ return false;
+ }
+ catch (DirectoryNotFoundException)
+ {
+ return false;
+ }
}
private async Task RefreshMediaSourceItems(IEnumerable<MediaSourceInfo> items, CancellationToken cancellationToken)