Hi... I'll try again. I didn't expect hitting space to submit a post!
I've uploaded an update - tvdiary_0.0.1-3_mipsel.opk - to hopefully fix the defects reported.
1) tvdiary_status.jim failing to find the humaxtv PID under crontab.
I've put in the full path to /mod/bin/busybox/pgrep, and ensured the full path is used in all execs, and that the caught error message is logged too.
If there are still problems, I've put a couple of commented out lines at the top, to be uncommented in order to print the environment variables. I've noticed considerable differences between the environment seen by command-line and crontab, although not in the PATH on my machine. I have tried calling a script from crontab that cuts down the PATH & then calls tvdiary_status.jim, but that only managed to completely stop it running rather than reproduce the problem.
2) Programs without EPG entries logged as errors rather than added to the DB.
I've changed to record the channel name, then have "Not in EPG" as the name and "No information available" as the synopsis. This situation is most easily reproduced by watching CBBC in the middle of the night, or the adult channels in the middle of the day.
I haven't done anything about periodically purging the DB of aged data yet. But I think it would be useful to link that with pushing the recorded/watched information out to a remote hosting server. The information would then be available whether the Humax is turned on or not, and you don't have to make your Humax visible outside your firewall.
For showing more than one day's data I suggested calling the ajax sequentially to get several days data, and you could put date headers between them. A catch with this is that programs that span 2 days would appear on both days. So it'd probably need an option to say whether to include spanning programs at the beginning or end of the day, or both. While the day spanning code is being messed with, the requirement to only report whole days could also be removed. Totting up the total hours recorded or watched also needs to be considered, as that takes account of day boundaries and spanning programs.
I'd quite like to change it to return XML rather than a table, and use CSS to style it as a table. That way there's more flexibility to include the date in there as well as the time, and then decide whether to make it visible or not.
I think it also might be useful to distinguish watching recorded programs and watching live TV. I think this would help with what @cloud9 was alluding to in #24, and for me I leave the Humax on all night because it feeds to old pre-digital TV I use as an alarm clock. I'm not sure I'd immediately change the way it's displayed, but if it's rendered in XML one could use CSS to change the way it's displayed without having to change the CGI at all.