TV-Browser

EyeTV: Recording one Month off. Fix included.

Details

  • Description:
    Hide
    Recording something with EyeTV does not work if done on a day that does not exist one month later. The recording is one month off then.

    For example:
    Today is August 31. There will be no September 31, since september only has 30 days.
    Every recording I program today is set to one month later in EyeTV, no matter on which day it occurs.
    You can see the bug only on that special days. Trying tomorrow will NOT show the problem. The next day the bug will occur is October 31, since there is no November 31.

    Reason:
    Say the current date is today, (2010 , 8 , 31). The generated AppleScript contains this commands:



    set myDate to current date

    tell theISODate
    set year of myDate to item 1
    set month of myDate to item (item 2) of monthConstants
    set day of myDate to item 3
    end tell

    myDate is set to (2010, 8 ,31).
    When the month is set, for for a short time the date object contains a value of (2010 , 9 , 31) which is an illegal day. The system „repairs" that to (2010 , 10 , anything).
    One line after the day is set to 1. This leads to (2010 , 10 ,1) instead of (2010 , 9 , 1).

    Solution:

    I don´t understand why „current day" is used at all, since every part of this date object is overwritten immediately. It looks like „Hey, I need to generate /any/ date object as fast as possible" to me.

    I used that code successfully:

    Replace:
    set myDate to current date

    by:
    set myDate to date "1.1.1970 00:00:00"

    Since January has 31 days, the problem will never occur. That fixed it for me.

    Further problems:
    'grep'ing the sources for the right file I can see similar bugs at least in „thetubedriver" and „AppleiCalExporter", however, I did not look further in there. But the wrong code seems to be there, too.

    Show
    Recording something with EyeTV does not work if done on a day that does not exist one month later. The recording is one month off then. For example: Today is August 31. There will be no September 31, since september only has 30 days. Every recording I program today is set to one month later in EyeTV, no matter on which day it occurs. You can see the bug only on that special days. Trying tomorrow will NOT show the problem. The next day the bug will occur is October 31, since there is no November 31. Reason: Say the current date is today, (2010 , 8 , 31). The generated AppleScript contains this commands: set myDate to current date tell theISODate set year of myDate to item 1 set month of myDate to item (item 2) of monthConstants set day of myDate to item 3 end tell myDate is set to (2010, 8 ,31). When the month is set, for for a short time the date object contains a value of (2010 , 9 , 31) which is an illegal day. The system „repairs" that to (2010 , 10 , anything). One line after the day is set to 1. This leads to (2010 , 10 ,1) instead of (2010 , 9 , 1). Solution: I don´t understand why „current day" is used at all, since every part of this date object is overwritten immediately. It looks like „Hey, I need to generate /any/ date object as fast as possible" to me. I used that code successfully: Replace: set myDate to current date by: set myDate to date "1.1.1970 00:00:00" Since January has 31 days, the problem will never occur. That fixed it for me. Further problems: 'grep'ing the sources for the right file I can see similar bugs at least in „thetubedriver" and „AppleiCalExporter", however, I did not look further in there. But the wrong code seems to be there, too.
  • Environment:
    Mac OS X 10.6.4 with EyeTV

Attachments

  1. mylyn-context.zip
    (10 kB)
    Michael Keppler
    05.09.2010

Activity

Hide
Michael Keppler added a comment - 05.09.2010
Danke für deine Analyse. Ich habe den Fix etwas anders gemacht, da ich nicht sicher bin, ob die Initialisierung mit dem String auf Systemen mit anderem Locale korrekt funktioniert. Aber der Fix verwendet noch immer deinen Januar-Trick, indem er erst fest diesen Monat setzt, dann den gewünschten Tag und final den gewünschten Monat. Konnte das aber wie immer ohne Mac nicht testen...
Show
Michael Keppler added a comment - 05.09.2010 Danke für deine Analyse. Ich habe den Fix etwas anders gemacht, da ich nicht sicher bin, ob die Initialisierung mit dem String auf Systemen mit anderem Locale korrekt funktioniert. Aber der Fix verwendet noch immer deinen Januar-Trick, indem er erst fest diesen Monat setzt, dann den gewünschten Tag und final den gewünschten Monat. Konnte das aber wie immer ohne Mac nicht testen...
Hide
Jörg Roßdeutscher added a comment - 08.09.2010
Hallo, das hatte ich auch zuerst so, fand es dann aber anders schöner. Egal. Habe mir den Code angesehen, müsste funktionieren. Ich traue mich wegen diverser anderer Sachen nicht, meine Rechneruhr zu verstellen und das zu testen - spätestens im Februar haben wir dann eine halbe Woche Ärger, falls der Bug noch da ist. %-)
Gruß, Jörg
Show
Jörg Roßdeutscher added a comment - 08.09.2010 Hallo, das hatte ich auch zuerst so, fand es dann aber anders schöner. Egal. Habe mir den Code angesehen, müsste funktionieren. Ich traue mich wegen diverser anderer Sachen nicht, meine Rechneruhr zu verstellen und das zu testen - spätestens im Februar haben wir dann eine halbe Woche Ärger, falls der Bug noch da ist. %-) Gruß, Jörg

People

Dates

  • Created:
    31.08.2010
    Updated:
    08.09.2010
    Resolved:
    05.09.2010