parent
6a6d6f9e0d
commit
5fe1ce1eff
|
@ -71,9 +71,28 @@ namespace NzbDrone.Core.Extras
|
||||||
.Select(e => e.Trim(' ', '.'))
|
.Select(e => e.Trim(' ', '.'))
|
||||||
.ToList();
|
.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)
|
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));
|
var matchingExtension = wantedExtensions.FirstOrDefault(e => matchingFilename.EndsWith(e));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue