Attempt to find output dir from parent folder

This commit is contained in:
2012-01-21 19:18:17 +00:00
parent b7c93faebb
commit 8b1263c324

View File

@@ -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);
}