1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-02-27 08:33:21 +00:00

Fixed issue trying getting parent of drive

This commit is contained in:
Mark McDowall 2014-06-09 18:26:49 -07:00
parent cdca754b0f
commit 95f4d71c68
3 changed files with 14 additions and 2 deletions

View file

@ -268,5 +268,18 @@ public void should_return_path_to_folder_instead_of_file()
result.OutputPath.Should().Be(@"C:\sorted\Droned.S01E01.Pilot.1080p.WEB-DL-DRONE".AsOsAgnostic());
}
[Test]
public void should_not_blow_up_if_storage_is_drive_root()
{
_completed.Items.First().Storage = @"C:\".AsOsAgnostic();
WithQueue(null);
WithHistory(_completed);
var result = Subject.GetItems().Single();
result.OutputPath.Should().Be(@"C:\".AsOsAgnostic());
}
}
}

View file

@ -162,7 +162,7 @@ private IEnumerable<DownloadClientItem> GetHistory()
if (!sabHistoryItem.Storage.IsNullOrWhiteSpace())
{
var parent = Directory.GetParent(sabHistoryItem.Storage);
if (parent.Name == sabHistoryItem.Title)
if (parent != null && parent.Name == sabHistoryItem.Title)
{
historyItem.OutputPath = parent.FullName;
}

View file

@ -6,7 +6,6 @@
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Download.Clients.Sabnzbd.Responses;
using NzbDrone.Core.Instrumentation.Extensions;
using RestSharp;
namespace NzbDrone.Core.Download.Clients.Sabnzbd