From b08ee41f45421c391148f8d8504b7b3f2138de98 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 5 May 2012 20:24:27 +0200 Subject: [PATCH] (bug 34927) Output media_type for list=filearchive Change-Id: I7c9b2f614ab319facfc9fb30893d82a9427e4253 --- RELEASE-NOTES-1.20 | 1 + includes/api/ApiQueryFilearchive.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index c796df3b9a..5743994001 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -110,6 +110,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. * (bug 32498) API now allows comparing pages using pageids * (bug 30975) API import of pages with invalid characters in this wiki leads to Fatal Error * (bug 30488) API now allows listing of backlinks/embeddedin/imageusage per pageid +* (bug 34927) Output media_type for list=filearchive === Languages updated in 1.20 === diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index 268b1e4611..b9607aa919 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -56,6 +56,7 @@ class ApiQueryFilearchive extends ApiQueryBase { $fld_dimensions = isset( $prop['dimensions'] ); $fld_description = isset( $prop['description'] ) || isset( $prop['parseddescription'] ); $fld_mime = isset( $prop['mime'] ); + $fld_mediatype = isset( $prop['mediatype'] ); $fld_metadata = isset( $prop['metadata'] ); $fld_bitdepth = isset( $prop['bitdepth'] ); @@ -68,6 +69,7 @@ class ApiQueryFilearchive extends ApiQueryBase { $this->addFieldsIf( array( 'fa_height', 'fa_width', 'fa_size' ), $fld_dimensions || $fld_size ); $this->addFieldsIf( 'fa_description', $fld_description ); $this->addFieldsIf( array( 'fa_major_mime', 'fa_minor_mime' ), $fld_mime ); + $this->addFieldsIf( 'fa_media_type', $fld_mediatype ); $this->addFieldsIf( 'fa_metadata', $fld_metadata ); $this->addFieldsIf( 'fa_bits', $fld_bitdepth ); @@ -165,6 +167,9 @@ class ApiQueryFilearchive extends ApiQueryBase { $row->fa_description, $title ); } } + if ( $fld_mediatype ) { + $file['mediatype'] = $row->fa_media_type; + } if ( $fld_metadata ) { $file['metadata'] = $row->fa_metadata ? ApiQueryImageInfo::processMetaData( unserialize( $row->fa_metadata ), $result ) @@ -235,6 +240,7 @@ class ApiQueryFilearchive extends ApiQueryBase { 'description', 'parseddescription', 'mime', + 'mediatype', 'metadata', 'bitdepth' ), @@ -261,6 +267,7 @@ class ApiQueryFilearchive extends ApiQueryBase { ' description - Adds description the image version', ' parseddescription - Parse the description on the version', ' mime - Adds MIME of the image', + ' mediatype - Adds the media type of the image', ' metadata - Lists EXIF metadata for the version of the image', ' bitdepth - Adds the bit depth of the version', ), -- 2.20.1