Skip to content

Commit

Permalink
Make MythWeb comply with UTC time when getting previews.
Browse files Browse the repository at this point in the history
Services API now requires UTC time input.  Add a function to get
it from the times pulled from the DB, and use that time
when getting previews.
  • Loading branch information
Robert McNamara committed Dec 2, 2011
1 parent 40cef91 commit e9e99da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,11 @@ function myth2unixtime($mythtime) {
function unix2mythtime($time) {
return date('Y-m-d\TH:i:s', $time);
}

/**
* Converts a unix timestamp into a myth timestamp
/**/
function unix2gmtmythtime($time) {
return gmdate('Y-m-d\TH:i:s', $time);
}

2 changes: 1 addition & 1 deletion modules/tv/classes/Program.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public function thumb_url($width=160, $height=120, $secs_in=-1) {
public static function get_preview_pixmap($hostname, $chanid, $starttime, $width=160, $height=120, $secs_in=null) {

return MythBackend::find($hostname)->httpRequest('Content/GetPreviewImage', array('ChanId' => $chanid,
'StartTime' => unix2mythtime($starttime),
'StartTime' => unix2gmtmythtime($starttime),
'Height' => $height,
'Width' => $width));
}
Expand Down

0 comments on commit e9e99da

Please sign in to comment.