|
|
|
@ -49,6 +49,19 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
Logger.ErrorException("An error has occurred while importing folder" + subfolder, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Todo: Process files directly in the drop folder
|
|
|
|
|
foreach(var videoFile in _diskScanProvider.GetVideoFiles(dropFolder, false))
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ProcessVideoFile(videoFile);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Logger.ErrorException("An error has occurred while importing video file" + videoFile, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void ProcessDownload(DirectoryInfo subfolderInfo)
|
|
|
|
@ -109,6 +122,25 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void ProcessVideoFile(string videoFile)
|
|
|
|
|
{
|
|
|
|
|
var seriesName = Parser.ParseSeriesName(Path.GetFileNameWithoutExtension(videoFile));
|
|
|
|
|
var series = _seriesProvider.FindSeries(seriesName);
|
|
|
|
|
|
|
|
|
|
if (series == null)
|
|
|
|
|
{
|
|
|
|
|
Logger.Trace("Unknown Series on Import: {0}", videoFile);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var episodeFile = _diskScanProvider.ImportFile(series, videoFile);
|
|
|
|
|
if (episodeFile != null)
|
|
|
|
|
{
|
|
|
|
|
_diskScanProvider.MoveEpisodeFile(episodeFile, true);
|
|
|
|
|
_metadataProvider.CreateForEpisodeFile(episodeFile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void TagFolder(DirectoryInfo directory, PostDownloadStatusType status)
|
|
|
|
|
{
|
|
|
|
|
//Turning off tagging folder for now, to stop messing people's series folders.
|
|
|
|
|