[mythtv-commits] Ticket #7455: timezone caching comparison in mythweb is wrong.

MythTV mythtv at cvs.mythtv.org
Fri Oct 30 15:47:03 UTC 2009


#7455: timezone caching comparison in mythweb is wrong.
------------------------------------------+---------------------------------
 Reporter:  frans.meulenbroeks@…          |       Owner:  kormoc 
     Type:  patch                         |      Status:  new    
 Priority:  minor                         |   Milestone:  unknown
Component:  Plugin - MythWeb              |     Version:  head   
 Severity:  medium                        |     Mlocked:  0      
------------------------------------------+---------------------------------
 problem: changes in timezone are never taken over by mythtv.

 "./classes/MythBackend.php" line 113 of 217 and next read:

     public function setTimezone() {
         if (!is_string($_SESSION['backend']['timezone']['value']) ||
 $_SESSION['backend']['timezone']['last_check_time'] - time() > 60*60*24) {
             $response = $this->sendCommand('QUERY_TIME_ZONE');
             $timezone = str_replace(' ', '_', $response[0]);
             $_SESSION['backend']['timezone']['value']           =
 $timezone;
             $_SESSION['backend']['timezone']['last_check_time'] = time();
         }

 This comparison:

  $_SESSION['backend']['timezone']['last_check_time'] - time() > 60*60*24)

 will normally yield a negative value as time() is later (and thus bigger0
 than the last checked time so once a value is set it will never be re-
 checked.

 Solution is simple:
 change into

 time() - $_SESSION['backend']['timezone']['last_check_time'] > 60*60*24)

 Btw: it would be nice if the system be forced to reread the timezone
 (people typically note it is wrong; change the settings but now have to
 wait 24hrs before the change takes effect)

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/7455>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list