Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

epg crontab problem #255

Open
blinkinglight opened this issue Aug 24, 2016 · 3 comments
Open

epg crontab problem #255

blinkinglight opened this issue Aug 24, 2016 · 3 comments

Comments

@blinkinglight
Copy link

blinkinglight commented Aug 24, 2016

hi,
i have problem with epg. when i press in admin "force update for epg" epg is ok. but then i run command line task update_epg.php in force mode, epg shows strange dates.

@azhurb
Copy link
Owner

azhurb commented Aug 26, 2016

Can you show this strange dates?

@blinkinglight
Copy link
Author

blinkinglight commented Aug 26, 2016

its only in mag254, mange epg looks good
incorrect (update_epg.php task) https://cl.ly/0u1N1E1E390P
correct (web force update for epg) https://cl.ly/3q19363B2n3J
epg id 303 http://dev-cfg.rubibox.lt/tmp.xml date: 2016-06-26
in db epg table time mismatch titles

@blinkinglight
Copy link
Author

blinkinglight commented Oct 22, 2016

i view what query returns:
`
public function getCurProgramAndFewNext($ch_id, $num_programs){

    $cur_program = $this->getCurProgram($ch_id);

    if (empty($cur_program['id'])){
        return array();
    }

    $epg = $this->db->from('epg')
        /// Mysql time format, see https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
        ->select('epg.*, UNIX_TIMESTAMP(epg.time) as start_timestamp, UNIX_TIMESTAMP(epg.time_to) as stop_timestamp, TIME_FORMAT(epg.time,"'._('%H:%i').'") as t_time, TIME_FORMAT(epg.time_to,"%H:%i") as t_time_to')
        ->where(
            array(
                'epg.ch_id' => $ch_id,
                'epg.time>='  => $cur_program['time']
            ))
        ->orderby('epg.time')
        ->limit($num_programs)
        ->get()
        ->all();

error_log(json_encode($epg));
`

and i got "{"id":"2888349","ch_id":"86","time":"2016-10-22 14:00:00","time_to":"2016-10-22 14:30:00","duration":"1800","name":"Transformeriai. Praimas",....."

but if i run query in mysql i got this
mysql> select name,TIME_FORMAT(epg.time_to,"%H:%i") as t_time_to from epg where time >= '2016-10-22 14:00:00' and ch_id = 86 order by time asc limit 1;
+---------+-----------+
| name | t_time_to |
+---------+-----------+
| Dvyniai | 16:45 |
+---------+-----------+
1 row in set (0.00 sec)

whats wrong with getCurProgramAndFewNext generated query?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants