From 5e0427f927d410bf5ed9c29c32afa62ea91084dc Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 30 Apr 2011 14:29:58 -0700 Subject: [PATCH] MediaFileProvider, ImportFile will return null if episode cannot be properly parsed. Will only try to parse the filename, not the full episode path. --- NzbDrone.Core/Providers/MediaFileProvider.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index ae0069951..7948facf5 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -82,7 +82,11 @@ namespace NzbDrone.Core.Providers if (!_repository.Exists(e => e.Path == Parser.NormalizePath(filePath))) { - var parseResult = Parser.ParseEpisodeInfo(filePath); + //Use only the filename, not the entire path + var parseResult = Parser.ParseEpisodeInfo(new FileInfo(filePath).Name); + + if (parseResult == null) + return null; //Stores the list of episodes to add to the EpisodeFile var episodes = new List(); @@ -170,7 +174,6 @@ namespace NzbDrone.Core.Providers } } - public void DeleteFromDb(int fileId) { _repository.Delete(fileId);