[mythtv] [PATCH] Mythweb imperial/metric units + extended forecast bug fixed

IvanK. chepati at yahoo.com
Wed Sep 29 10:36:31 EDT 2004


Chris,

this patch is against cvs from 9/21.  CVS seems to be down so I couldn't test 
it against current code.

This patch will convert between imperial and metric units depending on wether 
SIUnits in settings is Yes (if Yes, use metric).

It also fixes the extended forecast bug that skips a day.  The problem is with 
the data we retrieve from msnbc.com.  Here's a sample:

4|5|6|7|1|09/29/2004|09/30/2004|10/01/2004|10/02/2004|10/03/2004

The first five fields are the day of the week digits for the next five days, 
and the next five fields are the supposed dates corresponding to these day of 
week digits.

4 (Thursday) is claimed to be 9/29/2004, while in fact that's Wednesday, day 
of week 3.

What the patch does is it assumes the correct part is the day of the week, 
because it's always the day after tomorrow and it seems logical that your 
extended forecast should begin with tomorrow.  It then calculates what day of 
the week the supposed date falls on and compares it against the day of the 
week we got from msnbc.com.  If different, it calculates what the real date 
should be and sets that, otherwise it accepts the supplied date.  This way 
once, and if, msnbc.com gets their data right, we'll still be getting the 
correct dates.  Let me know if this doesn't make sense.

IvanK.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythweb_metric_units.patch
Type: text/x-diff
Size: 8533 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20040929/8f68de7f/mythweb_metric_units.bin


More information about the mythtv-dev mailing list