mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-10 23:29:53 +02:00
Fixed: Issue extracting subtitle information for unknown episodes
This commit is contained in:
parent
07bd159436
commit
32c32e2f88
@ -4,6 +4,7 @@
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Extras.Files;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.MediaFiles.EpisodeImport.Aggregation;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Tv;
|
||||
@ -78,11 +79,11 @@ public override IEnumerable<ExtraFile> ProcessFiles(Series series, List<string>
|
||||
SeasonNumber = localEpisode.SeasonNumber,
|
||||
EpisodeFileId = firstEpisode.EpisodeFileId,
|
||||
RelativePath = series.Path.GetRelativePath(possibleSubtitleFile),
|
||||
Language = localEpisode.SubtitleInfo.Language,
|
||||
LanguageTags = localEpisode.SubtitleInfo.LanguageTags,
|
||||
Title = localEpisode.SubtitleInfo.Title,
|
||||
Language = localEpisode.SubtitleInfo?.Language ?? Language.Unknown,
|
||||
LanguageTags = localEpisode.SubtitleInfo?.LanguageTags ?? new List<string>(),
|
||||
Title = localEpisode.SubtitleInfo?.Title,
|
||||
Extension = extension,
|
||||
Copy = localEpisode.SubtitleInfo.Copy
|
||||
Copy = localEpisode.SubtitleInfo?.Copy ?? 0
|
||||
};
|
||||
|
||||
subtitleFiles.Add(subtitleFile);
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Extras.Subtitles;
|
||||
using NzbDrone.Core.Parser;
|
||||
@ -30,6 +31,11 @@ public LocalEpisode Aggregate(LocalEpisode localEpisode, DownloadClientItem down
|
||||
return localEpisode;
|
||||
}
|
||||
|
||||
if (localEpisode.Episodes.Empty())
|
||||
{
|
||||
return localEpisode;
|
||||
}
|
||||
|
||||
var firstEpisode = localEpisode.Episodes.First();
|
||||
var episodeFile = firstEpisode.EpisodeFile.Value;
|
||||
localEpisode.SubtitleInfo = CleanSubtitleTitleInfo(episodeFile, path);
|
||||
|
Loading…
Reference in New Issue
Block a user