1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed the broken tests

This commit is contained in:
Mark McDowall 2013-08-02 20:28:17 -07:00
parent 1c5e30bbd0
commit 177e4b850e

View File

@ -65,6 +65,8 @@ public virtual List<RootFolder> AllWithUnmappedFolders()
public virtual RootFolder Add(RootFolder rootFolder)
{
var all = All();
if (String.IsNullOrWhiteSpace(rootFolder.Path) || !Path.IsPathRooted(rootFolder.Path))
throw new ArgumentException("Invalid path");
@ -74,7 +76,8 @@ public virtual RootFolder Add(RootFolder rootFolder)
if (All().Exists(r => DiskProvider.PathEquals(r.Path, rootFolder.Path)))
throw new InvalidOperationException("Recent directory already exist.");
if (DiskProvider.PathEquals(_configService.DownloadedEpisodesFolder, rootFolder.Path))
if (!String.IsNullOrWhiteSpace(_configService.DownloadedEpisodesFolder) &&
DiskProvider.PathEquals(_configService.DownloadedEpisodesFolder, rootFolder.Path))
throw new InvalidOperationException("Drone Factory folder cannot be used.");
_rootFolderRepository.Insert(rootFolder);