mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
MediaFileProvider, ImportFile will return null if episode cannot be properly parsed. Will only try to parse the filename, not the full episode path.
This commit is contained in:
parent
9518c61fc2
commit
5e0427f927
1 changed files with 5 additions and 2 deletions
|
@ -82,7 +82,11 @@ namespace NzbDrone.Core.Providers
|
|||
|
||||
if (!_repository.Exists<EpisodeFile>(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<Episode>();
|
||||
|
@ -170,7 +174,6 @@ namespace NzbDrone.Core.Providers
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void DeleteFromDb(int fileId)
|
||||
{
|
||||
_repository.Delete<EpisodeFile>(fileId);
|
||||
|
|
Loading…
Reference in a new issue