diff --git a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php index 82f0e6d..11cae9e 100644 --- a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php +++ b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php @@ -91,8 +91,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug } } - protected function identifyOutputDir($dir, $file) { - // TODO - Generate the correct output directory, apply any special case mappings, and ensure the destination exists + protected function identifyOutputDir($dir, $file, $try_parent = true) { if (is_null($this->output_dir_cache)) { $this->scanOutputDir(); } @@ -108,6 +107,11 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug } } + // Filename not recognised, try the parent directory name instead + if ($try_parent) { + return identifyOutputDir(dirname($dir), basename($dir), false); + } + throw new DownloadDispatcher_Exception_UnidentifiedContent($file); }