1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00

Fix issue on in ImportFile

This commit is contained in:
kay.one 2011-06-19 10:57:35 -07:00
parent 7560a70dd4
commit f211f99960

View File

@ -49,7 +49,7 @@ public virtual List<EpisodeFile> Scan(Series series)
return new List<EpisodeFile>();
}
var mediaFileList = GetMediaFileList(series.Path);
var mediaFileList = GetVideoFiles(series.Path);
var fileList = new List<EpisodeFile>();
foreach (var filePath in mediaFileList)
@ -137,7 +137,7 @@ public virtual EpisodeFile ImportFile(Series series, string filePath)
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 @@ public virtual void CleanUp(List<EpisodeFile> files)
public virtual void Update(EpisodeFile episodeFile)
{
_database.Update(episodeFile);
}
}
public virtual EpisodeFile GetEpisodeFile(int episodeFileId)
{
@ -219,7 +219,7 @@ public virtual Tuple<int, int> GetEpisodeFilesCount(int seriesId)
return new Tuple<int, int>(avilableEpisodes.Count, episodeTotal.Count);
}
private List<string> GetMediaFileList(string path)
private List<string> GetVideoFiles(string path)
{
Logger.Debug("Scanning '{0}' for episodes", path);
@ -236,7 +236,7 @@ public virtual List<EpisodeFile> ImportNewFiles(string path, Series series)
var result = new List<EpisodeFile>();
//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)
{