Brion VIBBER has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/337056 )
Change subject: requeueTranscodes.php: allow specifying --audio or --video
......................................................................
requeueTranscodes.php: allow specifying --audio or --video
This'll make processing video files on Commons faster by skipping
the much larger set of audio files when using --video option.
If neither option is specified, both audio and video are processed.
Change-Id: Id169f981f802bedff5dbb84bfa4a5734954e59ef
---
M maintenance/requeueTranscodes.php
1 file changed, 14 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler
refs/changes/56/337056/1
diff --git a/maintenance/requeueTranscodes.php
b/maintenance/requeueTranscodes.php
index 0eda5e2..0cc1242 100644
--- a/maintenance/requeueTranscodes.php
+++ b/maintenance/requeueTranscodes.php
@@ -20,13 +20,26 @@
$this->addOption( "missing", "queue formats that were never
started",
false, false );
$this->addOption( "all", "re-queue all output formats", false,
false );
+ $this->addOption( "audio", "process audio files (defaults to
all media types)", false, false );
+ $this->addOption( "video", "process video files (defaults to
all media types)", false, false );
$this->mDescription = "re-queue existing and missing media
transcodes.";
}
public function execute() {
$this->output( "Cleanup transcodes:\n" );
$dbr = wfGetDB( DB_SLAVE );
- $where = [ 'img_media_type' => [ 'AUDIO', 'VIDEO' ] ];
+ $types = [];
+ if ( $this->hasOption( 'audio' ) ) {
+ $types[] = 'AUDIO';
+ }
+ if ( $this->hasOption( 'video' ) ) {
+ $types[] = 'VIDEO';
+ }
+ if ( !$types ) {
+ // Default to all if none specified
+ $types = [ 'AUDIO', 'VIDEO' ];
+ }
+ $where = [ 'img_media_type' => $types ];
if ( $this->hasOption( 'file' ) ) {
$title = Title::newFromText( $this->getOption( 'file'
), NS_FILE );
if ( !$title ) {
--
To view, visit https://gerrit.wikimedia.org/r/337056
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id169f981f802bedff5dbb84bfa4a5734954e59ef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits