diff options
author | Dave <vdr@pickles.me.uk> | 2012-02-25 14:05:30 +0000 |
---|---|---|
committer | Dave <vdr@pickles.me.uk> | 2012-02-25 14:05:30 +0000 |
commit | 2ed781ca859983524f9fbfd7c1acef8d527b2a5e (patch) | |
tree | cae5d44ea5f775e29bc6219155f457562e83780a | |
parent | e3cc1a7fc9d51d7b3b41af3fdf1872d9b51afef1 (diff) | |
download | vdrtva-0.1.1.tar.gz vdrtva-0.1.1.tar.bz2 |
Made logging more verbose.v0.1.1
Fixed segfault when VDR started with -h.
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | vdrtva.c | 29 |
3 files changed, 24 insertions, 12 deletions
@@ -34,7 +34,9 @@ VDR Plugin 'vdrtva' Revision History - Fixed OSD setup menu. - Removed duplicates from 'suggestions' report. -2012-02-20: Version 0.1.1 +2012-02-23: Version 0.1.1 - When timer clash detected, check alternatives for further clashes. - Disable functions needing CRID data if none captured yet. - Optionally email a daily report. +- 'Permanently' remove duplicates from suggestions. +- Fixed segfault when VDR called with -h. @@ -12,6 +12,7 @@ Some events have a series CRID but no item CRID - how to handle these? Delete a series link if the only timer is manually deleted. +Gather CRID data immediately when VDR started. + Bugs: - 'Suggestions' list in memory contains duplicates (removed by SVDRP output). Very rare crash 'pure virtual method called' in plugin. @@ -102,7 +102,6 @@ cPluginvdrTva::cPluginvdrTva(void) cPluginvdrTva::~cPluginvdrTva() { // Clean up after yourself! - delete statusMonitor; } const char *cPluginvdrTva::CommandLineHelp(void) @@ -221,6 +220,7 @@ void cPluginvdrTva::Stop(void) Filter = NULL; } tvalog.MailLog(); + if(statusMonitor) delete statusMonitor; } void cPluginvdrTva::Housekeeping(void) @@ -346,16 +346,13 @@ cString cPluginvdrTva::SVDRPCommand(const char *Command, const char *Option, int } else if (strcasecmp(Command, "LSTS") == 0) { if (SuggestCRIDs && (SuggestCRIDs->MaxNumber() >= 1)) { - SuggestCRIDs->Sort(); ReplyCode = 250; cSuggestCRID *suggest = SuggestCRIDs->First(); while (suggest) { cSuggestCRID *next = SuggestCRIDs->Next(suggest); - if (!next || strcmp(next->iCRID(), suggest->iCRID()) || strcmp(next->gCRID(), suggest->gCRID())) { - cChanDA *chanDA = ChanDAs->GetByChannelID(suggest->Cid()); - if(chanDA) { - reply.Append("%s%s %s%s\n", chanDA->DA(), suggest->iCRID(), chanDA->DA(), suggest->gCRID()); - } + cChanDA *chanDA = ChanDAs->GetByChannelID(suggest->Cid()); + if(chanDA) { + reply.Append("%s%s %s%s\n", chanDA->DA(), suggest->iCRID(), chanDA->DA(), suggest->gCRID()); } suggest = next; } @@ -446,6 +443,17 @@ void cPluginvdrTva::StopDataCapture() if (Filter) { delete Filter; Filter = NULL; + if (SuggestCRIDs && (SuggestCRIDs->MaxNumber() >= 1)) { // De-dup the suggestions list. + SuggestCRIDs->Sort(); + cSuggestCRID *suggest = SuggestCRIDs->First(); + while (suggest) { + cSuggestCRID *next = SuggestCRIDs->Next(suggest); + if (next && !strcmp(next->iCRID(), suggest->iCRID()) && !strcmp(next->gCRID(), suggest->gCRID())) { + SuggestCRIDs->Del(suggest); + } + suggest = next; + } + } isyslog("vdrtva: Data capture stopped"); } } @@ -683,7 +691,7 @@ void cPluginvdrTva::FindAlternatives(const cEvent *event) cChanDA *chanda = ChanDAs->GetByChannelID(channel->Number()); cEventCRID *eventcrid = EventCRIDs->GetByID(channel->Number(), event->EventID()); if (!eventcrid || !chanda) { - isyslog("vdrtva: Cannot find alternatives for '%s'", event->Title()); + REPORT("Cannot find alternatives for '%s' - no series link data", event->Title()); return; } bool found = false; @@ -781,9 +789,10 @@ bool cPluginvdrTva::CreateTimerFromEvent(const cEvent *event) { if (timer->Parse(timercmd)) { cTimer *t = Timers.GetTimer(timer); if (!t) { + timer->SetEvent(event); Timers.Add(timer); Timers.SetModified(); - REPORT("timer %s added on %s", *timer->ToDescr(), *DateString(timer->StartTime())); + REPORT("Timer created for '%s' on %s, %s %04d-%04d", etitle, channel->Name(), *DateString(starttime), timer->Start(), timer->Stop()); return true; } isyslog("vdrtva: Duplicate timer creation attempted for %s on %s", *timer->ToDescr(), *DateString(timer->StartTime())); @@ -793,7 +802,7 @@ bool cPluginvdrTva::CreateTimerFromEvent(const cEvent *event) { // Report actions to syslog if we don't want an email. -void tvasyslog(const char *Fmt, ...) { +void cPluginvdrTva::tvasyslog(const char *Fmt, ...) { va_list ap; char buff[4096]; |