[mythtv] Questions on housekeeper thread
William Uther
willu.mailingLists at cse.unsw.edu.au
Tue Feb 6 22:56:41 UTC 2007
On Mon, 5 Feb 2007 21:17:58 -0500, Chris Pinkham wrote:
> That is different than the actual way things work. The fix could be
> as simple as changing the text to something like this:
>
> "For example, setting Start to 11 and End to 13 would mean that the
> process would only run between 11:00 AM and 1:59 PM."
Good fix. :) I'll update the patch tonight (Aus time). If you don't
get to it first.
>> ii) At the moment the code is written to call MFD after the start
>> time, and before the end time. If the end time is before the start
>> time then MFD will not be run. This makes it impossible to say that
>> you want to run MFD in the middle of the night, between 11pm and
>> 1am. If you put in a start time of 11pm and an end time of 1am,
>> there are no times on an individual day that are after 11pm and
>> before 1am, and MFD will not be run. This would seem like a good bug
>> to fix.
>
> I was thinking about this the other day, but considered it another bug
> so I wasn't going to say it needed to be fixed as part of your current
> patch.
Yup.
> If you want to roll it in together, that is OK with me. Just
> attach a new patch to the existing ticket. I think the ability to
> span midnight is useful and there is no good reason I see that we
> shouldn't allow it. It will need a bit of logic in your existing
> patch
> to be modified though.
Yup.
> The big difference is probably that if we want
> to run mfdb between 11pm and 3am, we don't mind if mfdb runs twice in
> the same day at 1:30am and again at 11:45pm which would be blocked by
> the current code/patch.
Yup. And we do mind if it runs on two separate days, but in the same
"period".
e.g. If you have a start time of 2pm and an end time of 10am, you
don't want two runs at 5pm and 7am only 14 hours apart.
Here is one thought:
QDate today = now.date();
QDate yesterday = today.addDays(-1);
QTime startTime = QTime(minhour, 0);
QTime endTime = QTime(maxhour, 30);
// Make laststart be the last time an 'ok to run' period started.
QDateTime startToday(today, startTime);
QDateTime startYesterday(yesterday, startTime);
QDateTime lastStart = (now >= startToday) ? startToday :
startYesterday;
// Make lastend be the last time an 'ok to run' period ended.
QDateTime endToday(today, endTime);
QDateTime endYesterday(yesterday, endTime);
QDateTime lastEnd = (now >= endToday) ? endToday : endYesterday;
boolean OkToRun =
(lastEnd < lastStart) && // in an 'ok to run' period
(lastrun < lastStart); // Haven't yet run this period
This changes the inclusive end times to be exact times that are
offset by 30 mins. With this setup there is always at least a 30
minute period each day where it is ok to run.
> If you want to make this a separate patch
> than the existing one, I'm fine with that. I was thinking of
> committing
> your other patch tonight anyway since it has been working fine on my
> system so far.
A separate patch seems like a good idea. :) This is a change that
will require a whole lot more testing.
Will :-}
More information about the mythtv-dev
mailing list