summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave <vdr@pickles.me.uk>2012-07-08 10:58:40 +0100
committerDave <vdr@pickles.me.uk>2012-07-08 10:58:40 +0100
commitc7bb8d4f334000a7bb9f2824af16bf5b80993147 (patch)
treef537d6923199403e86df8b74190d9bb7a0c2ec8a
parent20882fc6759c82881dbb21de1bbcd4442596584f (diff)
downloadvdrtva-c7bb8d4f334000a7bb9f2824af16bf5b80993147.tar.gz
vdrtva-c7bb8d4f334000a7bb9f2824af16bf5b80993147.tar.bz2
Delete any remaining timers when deleting a series link.
-rw-r--r--README18
-rw-r--r--TODO2
-rw-r--r--vdrtva.c24
-rw-r--r--vdrtva.h1
4 files changed, 38 insertions, 7 deletions
diff --git a/README b/README
index 0da5804..a050112 100644
--- a/README
+++ b/README
@@ -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:
diff --git a/TODO b/TODO
index 30a91a1..d343fb5 100644
--- a/TODO
+++ b/TODO
@@ -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.
diff --git a/vdrtva.c b/vdrtva.c
index 0884de7..c4b696f 100644
--- a/vdrtva.c
+++ b/vdrtva.c
@@ -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;
diff --git a/vdrtva.h b/vdrtva.h
index 76f42e5..c824db6 100644
--- a/vdrtva.h
+++ b/vdrtva.h
@@ -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);
};