Renamed the codebase to RippingCluster
Since the new design is engine agnostic, removed HandBrake from the class names.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once '../config.php';
|
||||
require_once HandBrakeCluster_Lib . 'HandBrakeCluster/Main.class.php';
|
||||
require_once RippingCluster_Lib . 'RippingCluster/Main.class.php';
|
||||
|
||||
?>
|
||||
|
||||
@@ -5,15 +5,15 @@ define('HBC_File', 'index');
|
||||
require '_inc.php';
|
||||
|
||||
try {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$smarty = $main->smarty();
|
||||
|
||||
$page = new HandBrakeCluster_Page($smarty, $main->request());
|
||||
$page = new RippingCluster_Page($smarty, $main->request());
|
||||
if ($page->evaluate()) {
|
||||
$smarty->display('index.tpl');
|
||||
}
|
||||
|
||||
} catch (HandBrakeCluster_Exception $e) {
|
||||
} catch (RippingCluster_Exception $e) {
|
||||
die("Uncaught Exception: " . $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
|
||||
$this->smarty->assign('requested_page', htmlspecialchars($req->request_string()));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$config = $main->config();
|
||||
|
||||
$this->smarty->assign('display_exceptions', $config->get('debug.display_exceptions'));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
$running_jobs = HandBrakeCluster_Job::allWithStatus(HandBrakeCluster_JobStatus::RUNNING, 5);
|
||||
$completed_jobs = HandBrakeCluster_Job::allWithStatus(HandBrakeCluster_JobStatus::COMPLETE, 5);
|
||||
$failed_jobs = HandBrakeCluster_Job::allWithStatus(HandBrakeCluster_JobStatus::FAILED, 5);
|
||||
$running_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::RUNNING, 5);
|
||||
$completed_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::COMPLETE, 5);
|
||||
$failed_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::FAILED, 5);
|
||||
|
||||
$this->smarty->assign('running_jobs', $running_jobs);
|
||||
$this->smarty->assign('completed_jobs', $completed_jobs);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
$job_id = $this->request->get('id');
|
||||
$job = HandBrakeCluster_Job::fromId($job_id);
|
||||
$job = RippingCluster_Job::fromId($job_id);
|
||||
$this->smarty->assign('job', $job);
|
||||
|
||||
$client_log_entries = HandBrakeCluster_ClientLogEntry::recentForJob($job_id, 30);
|
||||
$worker_log_entries = HandBrakeCluster_WorkerLogEntry::recentForJob($job_id, 30);
|
||||
$client_log_entries = RippingCluster_ClientLogEntry::recentForJob($job_id, 30);
|
||||
$worker_log_entries = RippingCluster_WorkerLogEntry::recentForJob($job_id, 30);
|
||||
$this->smarty->assign('client_log_entries', $client_log_entries);
|
||||
$this->smarty->assign('worker_log_entries', $worker_log_entries);
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
if ($req->get('submit')) {
|
||||
$action = HandBrakeCluster_Main::issetelse($_POST['action'], HandBrakeCluster_Exception_InvalidParameters);
|
||||
$action = RippingCluster_Main::issetelse($_POST['action'], RippingCluster_Exception_InvalidParameters);
|
||||
|
||||
# If a bulk action was selected, the action will be a single term, otherwise it will also contain
|
||||
# the id of the single item to act upon. Work out which was used now.
|
||||
@@ -20,9 +20,9 @@ if ($req->get('submit')) {
|
||||
|
||||
$jobs = array();
|
||||
foreach ($job_ids as $job_id) {
|
||||
$job = HandBrakeCluster_Job::fromId($job_id);
|
||||
$job = RippingCluster_Job::fromId($job_id);
|
||||
if (!$job) {
|
||||
throw new HandBrakeCluster_Exception_InvalidParameters('job_id');
|
||||
throw new RippingCluster_Exception_InvalidParameters('job_id');
|
||||
}
|
||||
$jobs[] = $job;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ if ($req->get('submit')) {
|
||||
switch ($action) {
|
||||
case 'mark-failed': {
|
||||
foreach ($jobs as $job) {
|
||||
$job->updateStatus(HandBrakeCluster_JobStatus::FAILED);
|
||||
$job->updateStatus(RippingCluster_JobStatus::FAILED);
|
||||
}
|
||||
} break;
|
||||
|
||||
@@ -41,10 +41,10 @@ if ($req->get('submit')) {
|
||||
}
|
||||
|
||||
# Dispatch all the jobs in one run
|
||||
HandBrakeCluster_Job::runAllJobs();
|
||||
RippingCluster_Job::runAllJobs();
|
||||
|
||||
# Redirect to the job queued page to show the jobs were successfully dispatched
|
||||
HandBrakeCluster_Page::redirect('rips/setup-rip/queued');
|
||||
RippingCluster_Page::redirect('rips/setup-rip/queued');
|
||||
} break;
|
||||
|
||||
case 'delete': {
|
||||
@@ -54,34 +54,34 @@ if ($req->get('submit')) {
|
||||
} break;
|
||||
|
||||
default: {
|
||||
throw new HandBrakeCluster_Exception_InvalidParameters('action');
|
||||
throw new RippingCluster_Exception_InvalidParameters('action');
|
||||
}
|
||||
}
|
||||
|
||||
HandBrakeCluster_Page::redirect('jobs');
|
||||
RippingCluster_Page::redirect('jobs');
|
||||
|
||||
} else {
|
||||
|
||||
if (isset($_POST['view'])) {
|
||||
$statusName = urlencode($_POST['view']);
|
||||
HandBrakeCluster_Page::redirect("jobs/view/{$statusName}");
|
||||
RippingCluster_Page::redirect("jobs/view/{$statusName}");
|
||||
}
|
||||
|
||||
$statusName = $req->get('view', 'any');
|
||||
switch ($statusName) {
|
||||
case 'any': $status = null; break;
|
||||
case 'queued': $status = HandBrakeCluster_JobStatus::QUEUED; break;
|
||||
case 'running': $status = HandBrakeCluster_JobStatus::RUNNING; break;
|
||||
case 'complete': $status = HandBrakeCluster_JobStatus::COMPLETE; break;
|
||||
case 'failed': $status = HandBrakeCluster_JobStatus::FAILED; break;
|
||||
default: throw new HandBrakeCluster_Exception_InvalidParameters('view');
|
||||
case 'queued': $status = RippingCluster_JobStatus::QUEUED; break;
|
||||
case 'running': $status = RippingCluster_JobStatus::RUNNING; break;
|
||||
case 'complete': $status = RippingCluster_JobStatus::COMPLETE; break;
|
||||
case 'failed': $status = RippingCluster_JobStatus::FAILED; break;
|
||||
default: throw new RippingCluster_Exception_InvalidParameters('view');
|
||||
}
|
||||
|
||||
$jobs = array();
|
||||
if ($status) {
|
||||
$jobs = HandBrakeCluster_Job::allWithStatus($status);
|
||||
$jobs = RippingCluster_Job::allWithStatus($status);
|
||||
} else {
|
||||
$jobs = HandBrakeCluster_Job::all();
|
||||
$jobs = RippingCluster_Job::all();
|
||||
}
|
||||
|
||||
$this->smarty->assign('jobs', $jobs);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$client_log_entries = HandBrakeCluster_ClientLogEntry::recent(30);
|
||||
$worker_log_entries = HandBrakeCluster_WorkerLogEntry::recent(30);
|
||||
$client_log_entries = RippingCluster_ClientLogEntry::recent(30);
|
||||
$worker_log_entries = RippingCluster_WorkerLogEntry::recent(30);
|
||||
|
||||
$this->smarty->assign('client_log_entries', $client_log_entries);
|
||||
$this->smarty->assign('worker_log_entries', $worker_log_entries);
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
// Grab the name of this source
|
||||
$encoded_filename = null;
|
||||
if ($req->get('submit')) {
|
||||
$encoded_filename = HandBrakeCluster_Main::issetelse($_POST['id'], HandBrakeCluster_Exception_InvalidParameters);
|
||||
$encoded_filename = RippingCluster_Main::issetelse($_POST['id'], RippingCluster_Exception_InvalidParameters);
|
||||
|
||||
// Create the jobs from the request
|
||||
$jobs = HandBrakeCluster_Job::fromPostRequest($_POST['id'], $_POST['rip-options'], $_POST['rips']);
|
||||
$jobs = RippingCluster_Job::fromPostRequest($_POST['id'], $_POST['rip-options'], $_POST['rips']);
|
||||
|
||||
// Spawn the background client process to run all the jobs
|
||||
HandBrakeCluster_Job::runAllJobs();
|
||||
RippingCluster_Job::runAllJobs();
|
||||
|
||||
HandBrakeCluster_Page::redirect('rips/setup-rip/queued');
|
||||
RippingCluster_Page::redirect('rips/setup-rip/queued');
|
||||
|
||||
} elseif ($req->get('queued')) {
|
||||
$this->smarty->assign('rips_submitted', true);
|
||||
|
||||
} else {
|
||||
$this->smarty->assign('rips_submitted', false);
|
||||
$encoded_filename = $req->get('id', HandBrakeCluster_Exception_InvalidParameters);
|
||||
$encoded_filename = $req->get('id', RippingCluster_Exception_InvalidParameters);
|
||||
|
||||
$source = HandBrakeCluster_Rips_Source::loadEncoded($encoded_filename);
|
||||
$source = RippingCluster_Rips_Source::loadEncoded($encoded_filename);
|
||||
|
||||
$this->smarty->assign('source', $source);
|
||||
$this->smarty->assign('titles', $source->titles());
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
$source = HandBrakeCluster_Rips_Source::loadEncoded($req->get('id', HandBrakeCluster_Exception_InvalidParameters));
|
||||
$source = RippingCluster_Rips_Source::loadEncoded($req->get('id', RippingCluster_Exception_InvalidParameters));
|
||||
|
||||
$this->smarty->assign('source', $source);
|
||||
$this->smarty->assign('titles', $source->titles());
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$config = $main->config();
|
||||
|
||||
$lister = new HandBrakeCluster_Rips_SourceLister($config->get('rips.source_dir'));
|
||||
$lister = new RippingCluster_Rips_SourceLister($config->get('rips.source_dir'));
|
||||
$sources = $lister->sources();
|
||||
|
||||
$sources_cached = array();
|
||||
foreach ($sources as $source) {
|
||||
$sources_cached[$source->filename()] = HandBrakeCluster_Rips_Source::isCached($source->filename());
|
||||
$sources_cached[$source->filename()] = RippingCluster_Rips_Source::isCached($source->filename());
|
||||
}
|
||||
|
||||
$this->smarty->assign('sources', $sources);
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
define('HBC_File', 'run-jobs');
|
||||
|
||||
require_once '../config.php';
|
||||
require_once HandBrakeCluster_Lib . 'HandBrakeCluster/Main.class.php';
|
||||
require_once RippingCluster_Lib . 'RippingCluster/Main.class.php';
|
||||
|
||||
try {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$config = $main->config();
|
||||
$log = $main->log();
|
||||
|
||||
@@ -19,7 +19,7 @@ try {
|
||||
$gearman->setFailCallback("gearman_fail_callback");
|
||||
|
||||
// Retrieve a list of Created jobs
|
||||
$jobs = HandBrakeCluster_Job::allWithStatus(HandBrakeCluster_JobStatus::CREATED);
|
||||
$jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::CREATED);
|
||||
|
||||
foreach ($jobs as $job) {
|
||||
// Enqueue the job using gearman
|
||||
@@ -35,33 +35,33 @@ try {
|
||||
|
||||
$log->info("Job queue completed");
|
||||
|
||||
} catch (HandBrakeCluster_Exception $e) {
|
||||
} catch (RippingCluster_Exception $e) {
|
||||
die("Uncaught Exception (" . get_class($e) . "): " . $e->getMessage() . "\n");
|
||||
}
|
||||
|
||||
|
||||
function gearman_created_callback($gearman_task) {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$log = $main->log();
|
||||
|
||||
$job = HandBrakeCluster_Job::fromId($gearman_task->unique());
|
||||
$job->updateStatus(HandBrakeCluster_JobStatus::RUNNING);
|
||||
$job = RippingCluster_Job::fromId($gearman_task->unique());
|
||||
$job->updateStatus(RippingCluster_JobStatus::RUNNING);
|
||||
|
||||
$log->info("Job successfully queued with Gearman", $gearman_task->unique());
|
||||
}
|
||||
|
||||
function gearman_data_callback($gearman_task) {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$log = $main->log();
|
||||
|
||||
$log->debug("Got some data from gearman", $gearman_task->unique());
|
||||
}
|
||||
|
||||
function gearman_status_callback($gearman_task) {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$log = $main->log();
|
||||
|
||||
$job = HandBrakeCluster_Job::fromId($gearman_task->unique());
|
||||
$job = RippingCluster_Job::fromId($gearman_task->unique());
|
||||
$status = $job->currentStatus();
|
||||
|
||||
$rip_progress = $gearman_task->taskNumerator() / $gearman_task->taskDenominator();
|
||||
@@ -71,21 +71,21 @@ function gearman_status_callback($gearman_task) {
|
||||
}
|
||||
|
||||
function gearman_complete_callback($gearman_task) {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$log = $main->log();
|
||||
|
||||
$job = HandBrakeCluster_Job::fromId($gearman_task->unique());
|
||||
$job->updateStatus(HandBrakeCluster_JobStatus::COMPLETE);
|
||||
$job = RippingCluster_Job::fromId($gearman_task->unique());
|
||||
$job->updateStatus(RippingCluster_JobStatus::COMPLETE);
|
||||
|
||||
$log->info("Job Complete", $job->id());
|
||||
}
|
||||
|
||||
function gearman_fail_callback($gearman_task) {
|
||||
$main = HandBrakeCluster_Main::instance();
|
||||
$main = RippingCluster_Main::instance();
|
||||
$log = $main->log();
|
||||
|
||||
$job = HandBrakeCluster_Job::fromId($gearman_task->unique());
|
||||
$job->updateStatus(HandBrakeCluster_JobStatus::FAILED);
|
||||
$job = RippingCluster_Job::fromId($gearman_task->unique());
|
||||
$job->updateStatus(RippingCluster_JobStatus::FAILED);
|
||||
|
||||
$log->info("Job Failed", $job->id());
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>HandBrake Cluster WebUI</title>
|
||||
<title>Ripping Cluster WebUI</title>
|
||||
<script lang="javascript">
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="{$base_uri}styles/normal.css" />
|
||||
@@ -15,7 +15,7 @@
|
||||
<div id="container">
|
||||
|
||||
<div id="banner">
|
||||
<h1>HandBrake Cluster WebUI</h1>
|
||||
<h1>Ripping Cluster WebUI</h1>
|
||||
</div>
|
||||
|
||||
<div id="navigation">
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Powered by HandBrakeCluster WebUI {$version}. Written by Ben Roberts.
|
||||
Powered by RippingCluster WebUI {$version}. Written by Ben Roberts.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user