From a5f917bbc55e295896b8084f6657eb8b6abaf8a8 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Fri, 15 Jul 2016 15:33:36 -0300 Subject: Add TimedMediaHandler extension that allows display audio and video files in wiki pages, using the same syntax as for image files --- .../maintenance/resetTranscodes.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 extensions/TimedMediaHandler/maintenance/resetTranscodes.php (limited to 'extensions/TimedMediaHandler/maintenance/resetTranscodes.php') diff --git a/extensions/TimedMediaHandler/maintenance/resetTranscodes.php b/extensions/TimedMediaHandler/maintenance/resetTranscodes.php new file mode 100644 index 00000000..ca3493ed --- /dev/null +++ b/extensions/TimedMediaHandler/maintenance/resetTranscodes.php @@ -0,0 +1,41 @@ +mDescription = "Reset stalled transcodes, that are no longer in the job queue."; + } + public function execute() { + global $wgEnabledTranscodeSet; + $where = array( + "transcode_time_startwork" => NULL, + "transcode_time_error" => NULL + ); + $dbr = wfGetDB( DB_SLAVE ); + $res = $dbr->select( 'transcode', '*', $where, __METHOD__ ); + foreach ( $res as $row ) { + $title = Title::newFromText( $row->transcode_image_name, NS_FILE ); + // re-insert WebVideoTranscodeJob, + // will only be added if not in queue + // due to deduplication + $job = new WebVideoTranscodeJob( $title, array( + 'transcodeMode' => 'derivative', + 'transcodeKey' => $row->transcode_key, + ) ); + $job->insert(); + } + } +} + +$maintClass = 'ResetTranscodes'; // Tells it to run the class +require_once( RUN_MAINTENANCE_IF_MAIN ); -- cgit v1.2.3-54-g00ecf