Added Source class to parse HandBrake output

Added a Source class which executes HandBrake -t 0 to list the available titles and streams in a given source.
Added a placeholder on the source-details page to display HandBrake output
This commit is contained in:
2010-03-21 03:21:08 +00:00
parent 5bb99c0f58
commit 3207c28b5c
3 changed files with 56 additions and 6 deletions

View File

@@ -6,19 +6,22 @@ $config = $main->config();
// Grab the name of this source
$source_id = $req->get('id');
$source = base64_decode(str_replace('-', '/', $source_id));
$real_source = realpath($source);
$source_path = base64_decode(str_replace('-', '/', $source_id));
$real_source_path = realpath($source_path);
// Ensure the source is a valid directory, and lies below the configured source_dir
if (!is_dir($source)) {
if (!is_dir($source_path)) {
return;
}
$real_source_dir = realpath($config->get('rips.source_dir'));
if (substr($real_source, 0, strlen($real_source_dir)) != $real_source_dir) {
if (substr($real_source_path, 0, strlen($real_source_dir)) != $real_source_dir) {
return;
}
$source = new HandBrakeCluster_Rips_Source($source_path);
$this->smarty->assign('source_path', $source_path);
$this->smarty->assign('source', $source);
$this->smarty->assign('output', $source->output());
?>