(bug 34927) Output media_type for list=filearchive
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 5 May 2012 18:24:27 +0000 (20:24 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 5 May 2012 18:24:27 +0000 (20:24 +0200)
Change-Id: I7c9b2f614ab319facfc9fb30893d82a9427e4253

RELEASE-NOTES-1.20
includes/api/ApiQueryFilearchive.php

index c796df3..5743994 100644 (file)
@@ -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 ===
 
index 268b1e4..b9607aa 100644 (file)
@@ -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',
                        ),