1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-31 03:11:07 +02:00

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

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Net;
using NLog;
@ -41,11 +41,13 @@ public void DeleteEpisodeFile(Series series, EpisodeFile episodeFile)
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);
}