Relative episode file paths

This commit is contained in:
Mark McDowall 2014-07-23 16:43:54 -07:00
parent 10fc875715
commit 6671934c0f
63 changed files with 571 additions and 464 deletions

View file

@ -1,4 +1,5 @@
using System.Linq;
using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
@ -43,11 +44,12 @@ namespace NzbDrone.Core.MediaFiles
foreach (var existingFile in existingFiles)
{
var file = existingFile.First();
var episodeFilePath = Path.Combine(localEpisode.Series.Path, file.RelativePath);
if (_diskProvider.FileExists(file.Path))
if (_diskProvider.FileExists(episodeFilePath))
{
_logger.Debug("Removing existing episode file: {0}", file);
_recycleBinProvider.DeleteFile(file.Path);
_recycleBinProvider.DeleteFile(episodeFilePath);
}
moveFileResult.OldFiles.Add(file);