Skip to content

Commit

Permalink
番組表内各局の次の番組の長さが現在放送中の番組のものと同じになる不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed May 3, 2020
1 parent fcb61f0 commit 1453bff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions htdocs/api/epginfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function getEpgInfo($ch, $jkchannels, $chnum, $sid, $onid, $tsid){

// 次の番組
if (isset($epg->items->eventinfo[1]->startTime)){
$next_starttime = $epg->items->eventinfo[0]->startDate.' '.$epg->items->eventinfo[1]->startTime;
$next_starttime = $epg->items->eventinfo[1]->startDate.' '.$epg->items->eventinfo[1]->startTime;
} else {
$next_starttime = date('Y/m/d').'00:00:00';
}
Expand Down Expand Up @@ -135,12 +135,14 @@ function getEpgInfo($ch, $jkchannels, $chnum, $sid, $onid, $tsid){

// 開始/終了時間の解析
$starttimestamp = strtotime($starttime); //タイムスタンプに変換
$next_starttimestamp = strtotime($next_starttime); //タイムスタンプに変換
$endtimestamp = $starttimestamp + $duration; // 秒数を足す
$next_endtimestamp = $next_starttimestamp + $duration; // 秒数を足す
$starttime = date("H:i", $starttimestamp);
$next_starttime = date("H:i", $next_starttimestamp);
$endtime = date("H:i", $endtimestamp);

// 次の番組の開始/終了時間の解析
$next_starttimestamp = strtotime($next_starttime); //タイムスタンプに変換
$next_endtimestamp = $next_starttimestamp + $next_duration; // 秒数を足す
$next_starttime = date("H:i", $next_starttimestamp);
$next_endtime = date("H:i", $next_endtimestamp);

return array(
Expand Down

0 comments on commit 1453bff

Please sign in to comment.