diff options
| author | Dave <vdr@pickles.me.uk> | 2012-07-08 10:58:40 +0100 |
|---|---|---|
| committer | Dave <vdr@pickles.me.uk> | 2012-07-08 10:58:40 +0100 |
| commit | c7bb8d4f334000a7bb9f2824af16bf5b80993147 (patch) | |
| tree | f537d6923199403e86df8b74190d9bb7a0c2ec8a | |
| parent | 20882fc6759c82881dbb21de1bbcd4442596584f (diff) | |
| download | vdrtva-c7bb8d4f334000a7bb9f2824af16bf5b80993147.tar.gz vdrtva-c7bb8d4f334000a7bb9f2824af16bf5b80993147.tar.bz2 | |
Delete any remaining timers when deleting a series link.
| -rw-r--r-- | README | 18 | ||||
| -rw-r--r-- | TODO | 2 | ||||
| -rw-r--r-- | vdrtva.c | 24 | ||||
| -rw-r--r-- | vdrtva.h | 1 |
4 files changed, 38 insertions, 7 deletions
@@ -94,21 +94,25 @@ address daily. The plugin has an SVDRP interface which is mainly used for debugging, but could be used to interface with other applications. The commands are: -LLOG Print the pending log report +DELL <sCrid> Delete a series link and any timers by series CRID -LSTL Print the series links list +LLOG Print the pending log report -LSTS Print the 'suggested' events list +LSTL Print the series links list -LSTY Print the CRIDs for each event +LSTS Print the 'suggested' events list -LSTZ Print the Default Authority data for each channel +LSTY Print the CRIDs for each event -STOP Start and stop CRID data capture +LSTZ Print the Default Authority data for each channel + +STOP Start and stop CRID data capture STRT -UPDT Trigger an update of the series links. +UPDT Trigger an update of the series links. + +Files The plugin stores details of series links in the file links.data which is in the VIDEODIR/plugins directory. Entries in this file have the format: @@ -16,6 +16,8 @@ OSD for managing series links (work in progress). Option to select which device to use for CRID collection. +Remove reliance on VDR "Housekeeping" callback - causes problems when VDR is busy. + Bugs: Very rare crash 'pure virtual method called' in plugin - possibly solved. Spurious timer clash report - seen once, cause unknown. @@ -1489,6 +1489,7 @@ bool cLinks::DeleteItem(const char *sCRID) while (Item) { cLinkItem *next = Next(Item); if (!strcmp(Item->sCRID(), sCRID)) { + DeleteTimersForSCRID(sCRID); Del(Item); maxNumber--; dirty = true; @@ -1499,6 +1500,29 @@ bool cLinks::DeleteItem(const char *sCRID) return false; } +void cLinks::DeleteTimersForSCRID(const char *sCRID) +{ + if ((Timers.Count() == 0) || (!captureComplete)) return; + cTimer *ti = Timers.First(); + while (ti) { + cTimer *next = Timers.Next(ti); + const cEvent *event = ti->Event(); + if (event && ti->HasFlags(tfActive) && (ti->WeekDays() == 0)) { + cChannel *channel = Channels.GetByChannelID(event->ChannelID()); + cChanDA *chanda = ChanDAs.GetByChannelID(channel->Number()); + cEventCRID *eventcrid = EventCRIDs.GetByID(channel->Number(), event->EventID()); + if (eventcrid && chanda) { + cString scrid = cString::sprintf("%s%s", chanda->DA(),eventcrid->sCRID()); + if (!strcmp(scrid, sCRID)) { + isyslog ("vdrtva: deleting timer '%s' from deleted series %s", ti->File(), sCRID); + Timers.Del(ti); + } + } + } + ti = next; + } +} + void cLinks::Expire(void) { if (maxNumber == 0) return; @@ -193,4 +193,5 @@ class cLinks : public cRwLock, public cConfig<cLinkItem> { bool DeleteItem(const char *sCRID); void Expire(void); void SetUpdated(void); + void DeleteTimersForSCRID(const char *sCRID); }; |
