From 448631788856f429649626c60f767c4fbe759ae5 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 14 Aug 2016 21:05:35 +0200 Subject: [PATCH] Fixed: Manual Import failing to parse series title from certain nested folders. --- .../EpisodeImport/Manual/ManualImportService.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs index 61eea91de..b5a663c00 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs @@ -124,7 +124,14 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual folder = new FileInfo(file).Directory.FullName; } - var series = _parsingService.GetSeries(folder.GetRelativePath(file)); + var relativeFile = folder.GetRelativePath(file); + + var series = _parsingService.GetSeries(relativeFile.Split('\\', '/')[0]); + + if (series == null) + { + series = _parsingService.GetSeries(relativeFile); + } if (series == null && downloadId.IsNotNullOrWhiteSpace()) { @@ -190,7 +197,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual for (int i = 0; i < message.Files.Count; i++) { _logger.ProgressTrace("Processing file {0} of {1}", i + 1, message.Files.Count); - + var file = message.Files[i]; var series = _seriesService.GetSeries(file.SeriesId); var episodes = _episodeService.GetEpisodes(file.EpisodeIds); @@ -217,7 +224,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual if (file.DownloadId.IsNullOrWhiteSpace()) { - imported.AddRange(_importApprovedEpisodes.Import(new List { importDecision }, !existingFile)); + imported.AddRange(_importApprovedEpisodes.Import(new List { importDecision }, !existingFile)); } else