Ticket #6700: mythweb-6700-use_hostname_for_preview_pixmaps.patch

File mythweb-6700-use_hostname_for_preview_pixmaps.patch, 2.7 KB (added by sphery <mtdean@…>, 15 years ago)
  • mythweb/modules/tv/classes/Program.php

     
    515515        if ($height == 0)
    516516            $height = floor($width / $this->getAspect());
    517517
    518         return root."tv/get_pixmap/{$this->chanid}/{$this->recstartts}/$width/$height/$secs_in/$filename.{$width}x{$height}x$secs_in.png";
     518        return root."tv/get_pixmap/{$this->hostname}/{$this->chanid}/{$this->recstartts}/$width/$height/$secs_in/$filename.{$width}x{$height}x$secs_in.png";
    519519    }
    520520
    521521/**
     
    523523 *
    524524 * @todo, this should get put into a "recording" class or something like that.
    525525/**/
    526     public static function get_preview_pixmap($chanid, $starttime, $width=160, $height=120, $secs_in=null) {
     526    public static function get_preview_pixmap($hostname, $chanid, $starttime, $width=160, $height=120, $secs_in=null) {
    527527    // We have to calulate $secs_in from the db
    528528        if (is_null($secs_in))
    529529            $secs_in = _or(get_backend_setting('PreviewPixmapOffset'), 64)
    530530                       + _or(get_backend_setting('RecordPreRoll'), 0);
    531531
    532         return MythBackend::find()->httpRequest('GetPreviewImage', array('ChanId'      => $chanid,
     532        return MythBackend::find($hostname)->httpRequest('GetPreviewImage', array('ChanId'      => $chanid,
    533533                                                                         'StartTime'   => unix2mythtime($starttime),
    534534                                                                         'Height'      => $height,
    535535                                                                         'Width'       => $width,
  • mythweb/modules/tv/get_pixmap.php

     
    1313 *
    1414/**/
    1515
    16     $chanid     = $Path[2];
    17     $starttime  = $Path[3];
    18     $width      = $Path[4];
    19     $height     = $Path[5];
    20     $seconds_in = $Path[6];
     16    $hostname   = $Path[2];
     17    $chanid     = $Path[3];
     18    $starttime  = $Path[4];
     19    $width      = $Path[5];
     20    $height     = $Path[6];
     21    $seconds_in = $Path[7];
    2122
    2223    if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
    2324        if (strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $starttime) {
     
    2627        }
    2728    }
    2829
    29     $data = Program::get_preview_pixmap($chanid, $starttime, $width, $height, $seconds_in);
     30    $data = Program::get_preview_pixmap($hostname, $chanid, $starttime, $width, $height, $seconds_in);
    3031    if (strlen($data)) {
    3132        header('Pragma: public', true);
    3233        header('Content-Type: image/png');