aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
diff options
context:
space:
mode:
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)