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

Change subject: Add extmetadata to the ForeignAPIFile iiprops
......................................................................


Add extmetadata to the ForeignAPIFile iiprops

Also clean up iiprop handling in ForeignAPIRepo.

Change-Id: I4a1b46669658cc7b7d074f8fb85dd172e6c45633
---
M includes/filerepo/ForeignAPIRepo.php
M includes/filerepo/file/ForeignAPIFile.php
2 files changed, 21 insertions(+), 3 deletions(-)

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



diff --git a/includes/filerepo/ForeignAPIRepo.php 
b/includes/filerepo/ForeignAPIRepo.php
old mode 100644
new mode 100755
index 5eec9a5..07cc03b
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -42,6 +42,16 @@
         * Update the version every time you make breaking or significant 
changes. */
        const VERSION = "2.1";
 
+       /**
+        * List of iiprop values for the thumbnail fetch queries.
+        * @since 1.23
+        */
+       protected static $imageInfoProps = array(
+               'url',
+               'thumbnail',
+               'timestamp',
+       );
+
        var $fileFactory = array( 'ForeignAPIFile', 'newFromTitle' );
        /* Check back with Commons after a day */
        var $apiThumbCacheExpiry = 86400; /* 24*60*60 */
@@ -238,7 +248,7 @@
        function getThumbUrl( $name, $width = -1, $height = -1, &$result = 
null, $otherParams = '' ) {
                $data = $this->fetchImageQuery( array(
                        'titles' => 'File:' . $name,
-                       'iiprop' => 'url|timestamp',
+                       'iiprop' => self::getIIProps(),
                        'iiurlwidth' => $width,
                        'iiurlheight' => $height,
                        'iiurlparam' => $otherParams,
@@ -265,7 +275,7 @@
        function getThumbError( $name, $width = -1, $height = -1, $otherParams 
= '', $lang = null ) {
                $data = $this->fetchImageQuery( array(
                        'titles' => 'File:' . $name,
-                       'iiprop' => 'url|timestamp',
+                       'iiprop' => self::getIIProps(),
                        'iiurlwidth' => $width,
                        'iiurlheight' => $height,
                        'iiurlparam' => $otherParams,
@@ -486,6 +496,14 @@
        }
 
        /**
+        * @return string
+        * @since 1.23
+        */
+       protected static function getIIProps() {
+               return join( '|', self::$imageInfoProps );
+       }
+
+       /**
         * HTTP GET request to a mediawiki API (with caching)
         * @param $target string Used in cache key creation, mostly
         * @param $query array The query parameters for the API request
diff --git a/includes/filerepo/file/ForeignAPIFile.php 
b/includes/filerepo/file/ForeignAPIFile.php
index a1a6f26..fc9e176 100755
--- a/includes/filerepo/file/ForeignAPIFile.php
+++ b/includes/filerepo/file/ForeignAPIFile.php
@@ -86,7 +86,7 @@
         * @return string
         */
        static function getProps() {
-               return 
'timestamp|user|comment|url|size|sha1|metadata|mime|mediatype';
+               return 
'timestamp|user|comment|url|size|sha1|metadata|mime|mediatype|extmetadata';
        }
 
        // Dummy functions...

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4a1b46669658cc7b7d074f8fb85dd172e6c45633
Gerrit-PatchSet: 17
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to