jenkins-bot has submitted this change and it was merged.

Change subject: Add default implementation of getLength to base MediaHandler 
class
......................................................................


Add default implementation of getLength to base MediaHandler class

It was being called in File::getLength, but was only implemented
in a subclass, that's not even in core. Any method of a handler
class called from a method in File class should work on any
subclass of MediaHandler.

Change-Id: I94eda90ec3dd64b6ff2e3a5732aa539366cec521
---
M includes/media/MediaHandler.php
1 file changed, 14 insertions(+), 0 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php
index ee11599..e4caf35 100644
--- a/includes/media/MediaHandler.php
+++ b/includes/media/MediaHandler.php
@@ -798,4 +798,18 @@
        public function getDefaultRenderLanguage( File $file ) {
                return null;
        }
+
+       /**
+        * If its an audio file, return the length of the file. Otherwise 0.
+        *
+        * File::getLength() existed for a long time, but was calling a method
+        * that only existed in some subclasses of this class (The TMH ones).
+        *
+        * @param File $file
+        * @return float Length in seconds
+        * @since 1.23
+        */
+       public function getLength( $file ) {
+               return 0.0;
+       }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/120177
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I94eda90ec3dd64b6ff2e3a5732aa539366cec521
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to