mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed: Manual Import failing to parse series title from certain nested folders.
This commit is contained in:
parent
206ff12b71
commit
4486317888
@ -124,7 +124,14 @@ private ManualImportItem ProcessFile(string file, string downloadId, string fold
|
|||||||
folder = new FileInfo(file).Directory.FullName;
|
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())
|
if (series == null && downloadId.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
@ -190,7 +197,7 @@ public void Execute(ManualImportCommand message)
|
|||||||
for (int i = 0; i < message.Files.Count; i++)
|
for (int i = 0; i < message.Files.Count; i++)
|
||||||
{
|
{
|
||||||
_logger.ProgressTrace("Processing file {0} of {1}", i + 1, message.Files.Count);
|
_logger.ProgressTrace("Processing file {0} of {1}", i + 1, message.Files.Count);
|
||||||
|
|
||||||
var file = message.Files[i];
|
var file = message.Files[i];
|
||||||
var series = _seriesService.GetSeries(file.SeriesId);
|
var series = _seriesService.GetSeries(file.SeriesId);
|
||||||
var episodes = _episodeService.GetEpisodes(file.EpisodeIds);
|
var episodes = _episodeService.GetEpisodes(file.EpisodeIds);
|
||||||
@ -217,7 +224,7 @@ public void Execute(ManualImportCommand message)
|
|||||||
|
|
||||||
if (file.DownloadId.IsNullOrWhiteSpace())
|
if (file.DownloadId.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
imported.AddRange(_importApprovedEpisodes.Import(new List<ImportDecision> { importDecision }, !existingFile));
|
imported.AddRange(_importApprovedEpisodes.Import(new List<ImportDecision> { importDecision }, !existingFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user