From f211f999608bf742e94eb6bd923b7094171156e9 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 19 Jun 2011 10:57:35 -0700 Subject: [PATCH] Fix issue on in ImportFile --- NzbDrone.Core/Providers/MediaFileProvider.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index 8b2c39aad..9d936f2c6 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -49,7 +49,7 @@ namespace NzbDrone.Core.Providers return new List(); } - var mediaFileList = GetMediaFileList(series.Path); + var mediaFileList = GetVideoFiles(series.Path); var fileList = new List(); foreach (var filePath in mediaFileList) @@ -137,7 +137,7 @@ namespace NzbDrone.Core.Providers episodeFile.Quality = parseResult.Quality.QualityType; episodeFile.Proper = parseResult.Quality.Proper; episodeFile.SeasonNumber = parseResult.SeasonNumber; - var fileId = (int)_database.Insert(episodeFile); + var fileId = Convert.ToInt32(_database.Insert(episodeFile)); //This is for logging + updating the episodes that are linked to this EpisodeFile string episodeList = String.Empty; @@ -192,7 +192,7 @@ namespace NzbDrone.Core.Providers public virtual void Update(EpisodeFile episodeFile) { _database.Update(episodeFile); - } + } public virtual EpisodeFile GetEpisodeFile(int episodeFileId) { @@ -219,7 +219,7 @@ namespace NzbDrone.Core.Providers return new Tuple(avilableEpisodes.Count, episodeTotal.Count); } - private List GetMediaFileList(string path) + private List GetVideoFiles(string path) { Logger.Debug("Scanning '{0}' for episodes", path); @@ -236,7 +236,7 @@ namespace NzbDrone.Core.Providers var result = new List(); //Get all the files except those that are considered samples - var files = GetMediaFileList(path).Where(f => _diskProvider.GetSize(f) > 40000000 || !f.ToLower().Contains("sample")).ToList(); + var files = GetVideoFiles(path).Where(f => _diskProvider.GetSize(f) > 40000000 || !f.ToLower().Contains("sample")).ToList(); foreach (var file in files) {