|
|
|
@ -74,9 +74,28 @@ namespace NzbDrone.Core.Extras
|
|
|
|
|
.Select(e => e.Trim(' ', '.'))
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
var matchingFilenames = files.Where(f => Path.GetFileNameWithoutExtension(f).StartsWith(sourceFileName, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
|
var matchingFilenames = files.Where(f => Path.GetFileNameWithoutExtension(f).StartsWith(sourceFileName, StringComparison.InvariantCultureIgnoreCase)).ToList();
|
|
|
|
|
var filteredFilenames = new List<string>();
|
|
|
|
|
var hasNfo = false;
|
|
|
|
|
|
|
|
|
|
foreach (var matchingFilename in matchingFilenames)
|
|
|
|
|
{
|
|
|
|
|
// Filter out duplicate NFO files
|
|
|
|
|
|
|
|
|
|
if (matchingFilename.EndsWith(".nfo", StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (hasNfo)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hasNfo = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filteredFilenames.Add(matchingFilename);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var matchingFilename in filteredFilenames)
|
|
|
|
|
{
|
|
|
|
|
var matchingExtension = wantedExtensions.FirstOrDefault(e => matchingFilename.EndsWith(e));
|
|
|
|
|
|
|
|
|
|