Log warnings when deleting an episode file and the root folder is missing/empty

Closes #2305
This commit is contained in:
Mark McDowall 2017-11-24 18:51:27 -08:00
parent ae2a97763d
commit b45b2017a8
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Net;
using NLog;
@ -41,11 +41,13 @@ namespace NzbDrone.Core.MediaFiles
if (!_diskProvider.FolderExists(rootFolder))
{
_logger.Warn("Series' root folder ({0}) doesn't exist.", rootFolder);
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Series' root folder ({0}) doesn't exist.", rootFolder);
}
if (_diskProvider.GetDirectories(rootFolder).Empty())
{
_logger.Warn("Series' root folder ({0}) is empty.", rootFolder);
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Series' root folder ({0}) is empty.", rootFolder);
}