r41858 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41857‎ | r41858 | r41859 >
Date:21:16, 8 October 2008
Author:stipe
Status:old
Tags:
Comment:
support for time encoding now determined by path_type
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_StreamFile.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_Title.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php
@@ -272,9 +272,7 @@
273273 <switch distinction="quality">
274274 <? foreach ( $this->file_list as $file ) {
275275 $dAttr = ( $file->getNameKey() == $mvDefaultVideoQualityKey ) ? ' default="true"':'';
276 - if ( $file->getNameKey() == $mvDefaultVideoQualityKey ||
277 - $file->getNameKey() == $mvDefaultFlashQualityKey ||
278 - $file->getNameKey() == $mvDefaultVideoHighQualityKey )
 276+ if ( $file->supportsURLTimeEncoding() )
279277 {
280278 $dSrc = $this->mvTitle->getWebStreamURL( $file->getNameKey() );
281279 $startendattr = '';
Index: trunk/extensions/MetavidWiki/includes/MV_Title.php
@@ -276,24 +276,13 @@
277277 */
278278 function getWebStreamURL( $quality = null ) {
279279 global $mvVideoArchivePaths;
280 - global $mvDefaultVideoQualityKey, $mvDefaultVideoHighQualityKey, $mvDefaultFlashQualityKey;
281280 // @@todo mediawiki path for media (insted of hard link to $mvVideoArchive)
282281 // @@todo make sure file exisits
283282 if ( !$quality )$quality = $mvDefaultVideoQualityKey;
284 - $time_req = '';
285 - if ( $this->getStartTime() != '' && $this->getEndTime() != '' ) {
286 - if ( $quality == $mvDefaultVideoQualityKey ||
287 - $quality == $mvDefaultVideoHighQualityKey ) {
288 - //removed .anx
289 - $time_req = '?t=' . $this->getStartTime() . '/' . $this->getEndTime();
290 - } else if ( $quality == $mvDefaultFlashQualityKey ) {
291 - $time_req = '?t=' . $this->getStartTime() . '/' . $this->getEndTime();
292 - }
293 - }
294283 if ( $this->doesStreamExist() ) {
295284 // @@todo cache this / have a more organized store for StreamFiles in streamTitle
296285 $dbr = & wfGetDB( DB_READ );
297 - $result = $dbr->select( 'mv_stream_files', array( 'path' ), array (
 286+ $result = $dbr->select( 'mv_stream_files', '*', array (
298287 'stream_id' => $this->mvStream->id,
299288 'file_desc_msg' => $quality
300289 ) );
@@ -305,6 +294,14 @@
306295 $mvStreamFile = new MV_StreamFile( $this->mvStream, $streamFile );
307296 // if link empty return false:
308297 if ( $mvStreamFile->getFullURL() == '' )return false;
 298+ $time_req = '';
 299+ if ( $this->getStartTime() != '' && $this->getEndTime() != '' ) {
 300+ if ( $mvStreamFile->supportsURLTimeEncoding() ) {
 301+ //removed .anx
 302+ $time_req = '?t=' . $this->getStartTime() . '/' . $this->getEndTime();
 303+ }
 304+ }
 305+
309306 return $mvStreamFile->getFullURL() . $time_req;
310307 } else {
311308 // @@todo throw ERROR
Index: trunk/extensions/MetavidWiki/includes/MV_StreamFile.php
@@ -126,6 +126,9 @@
127127 function getPathType() {
128128 return $this->path_type;
129129 }
 130+ function supportsURLTimeEncoding() {
 131+ return $this->path_type == 'url_anx';
 132+ }
130133 function getFullURL() {
131134 // @@todo check on path if local
132135 return $this->getPath();

Status & tagging log