Actually copy avi files!

This commit is contained in:
2013-10-10 20:23:17 +01:00
parent e4fb0b7866
commit 5704112833

View File

@@ -261,7 +261,9 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug
throw new DownloadDispatcher_Exception_UnacceptableContent($source_file);
}
}
$this->copyOutputFile($type, $source_dir, $source_file, $destination_dir);
} break;
case 'mkv': {
// Verify that the file isn't a fake
@@ -273,21 +275,29 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug
DownloadDispatcher_LogEntry::warning($this->log, "Failed to parse contents of '{$source_dir}/{$source_file}'.");
throw new DownloadDispatcher_Exception_UnacceptableContent($source_file);
}
$this->copyOutputFile($type, $source_dir, $source_file, $destination_dir);
} // continue into the next case
} break;
default: {
DownloadDispatcher_LogEntry::info($this->log, "Copying '{$source_file}' to '{$destination_dir}'.");
$result = copy("{$source_dir}/{$source_file}", "{$destination_dir}/{$source_file}");
if ( ! $result) {
DownloadDispatcher_LogEntry::warning($this->log, "Failed to copy '{$source_dir}/{$source_file}' to output directory '{$destination_dir}'.");
throw new DownloadDispatcher_Exception_UnprocesseableContent($source_file);
}
// Accept anything we don't have a check for
$this->copyOutputFile($type, $source_dir, $source_file, $destination_dir);
}
}
return true;
}
protected function copyOutputFile($type, $source_dir, $source_file, $destination_dir) {
DownloadDispatcher_LogEntry::info($this->log, "Copying '{$source_file}' to '{$destination_dir}'.");
$result = copy("{$source_dir}/{$source_file}", "{$destination_dir}/{$source_file}");
if ( ! $result) {
DownloadDispatcher_LogEntry::warning($this->log, "Failed to copy '{$source_dir}/{$source_file}' to output directory '{$destination_dir}'.");
throw new DownloadDispatcher_Exception_UnprocesseableContent($source_file);
}
}
protected function renameOutput($dir) {
$cwd = getcwd();