Re: [vdr] EPG not purged if -E- option set

2013-09-01 Thread Dave Pickles

On 31/08/13 14:22, Klaus Schmidinger wrote:


Please try the attached patch. This one does compile ;-).

Klaus


I've confirmed the schedules do now expire with the -E- option set. Many 
thanks again.


Dave


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] EPG not purged if -E- option set

2013-08-31 Thread Dave
I run VDR 2.0.2 on a Raspberry Pi. The device runs continuously, so to 
avoid wearing out the SD card or needlessly spinning-up the USB disk 
drive I run VDR with the -E- option to prevent saving the EPG every 10 
minutes.


Today I created a timer for one programme in a long-running series and 
was surprised to find that the Series Link plugin had scheduled timers 
for earlier episodes, some broadcast several weeks ago! These timers 
were then automatically deleted of course.


Looking at the code, it seems that cleaning up the EPG schedules is a 
side-effect of writing the data file, so the -E- option disables both. 
Having the EPG grow unbounded is perhaps not desirable on devices such 
as the Raspberry Pi which have limited memory and CPU.


Dave

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] EPG not purged if -E- option set

2013-08-31 Thread Klaus Schmidinger

On 31.08.2013 11:06, Dave wrote:

I run VDR 2.0.2 on a Raspberry Pi. The device runs continuously, so to avoid 
wearing out the SD card or needlessly spinning-up the USB disk drive I run VDR 
with the -E- option to prevent saving the EPG every 10 minutes.

Today I created a timer for one programme in a long-running series and was 
surprised to find that the Series Link plugin had scheduled timers for earlier 
episodes, some broadcast several weeks ago! These timers were then 
automatically deleted of course.

Looking at the code, it seems that cleaning up the EPG schedules is a 
side-effect of writing the data file, so the -E- option disables both. Having 
the EPG grow unbounded is perhaps not desirable on devices such as the 
Raspberry Pi which have limited memory and CPU.


Please try the attached patch.

Klaus
--- epg.c	2013/08/23 10:46:33	3.1
+++ epg.c	2013/08/31 13:07:30
@@ -1169,7 +1169,8 @@
p-Cleanup(now);
}
   }
-  cSchedules::Dump();
+  if (epgDataFileName)
+ cSchedules::Dump();
 }
 
 static cEpgDataWriter EpgDataWriter;
@@ -1217,12 +1218,10 @@
  lastDump = 0;
   time_t now = time(NULL);
   if (now - lastDump  EPGDATAWRITEDELTA) {
- if (epgDataFileName) {
-if (Force)
-   EpgDataWriter.Perform();
-else if (!EpgDataWriter.Active())
-   EpgDataWriter.Start();
-}
+ if (Force)
+EpgDataWriter.Perform();
+ else if (!EpgDataWriter.Active())
+EpgDataWriter.Start();
  lastDump = now;
  }
 }
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] EPG not purged if -E- option set

2013-08-31 Thread Klaus Schmidinger

On 31.08.2013 15:09, Klaus Schmidinger wrote:

On 31.08.2013 11:06, Dave wrote:

I run VDR 2.0.2 on a Raspberry Pi. The device runs continuously, so to avoid 
wearing out the SD card or needlessly spinning-up the USB disk drive I run VDR 
with the -E- option to prevent saving the EPG every 10 minutes.

Today I created a timer for one programme in a long-running series and was 
surprised to find that the Series Link plugin had scheduled timers for earlier 
episodes, some broadcast several weeks ago! These timers were then 
automatically deleted of course.

Looking at the code, it seems that cleaning up the EPG schedules is a 
side-effect of writing the data file, so the -E- option disables both. Having 
the EPG grow unbounded is perhaps not desirable on devices such as the 
Raspberry Pi which have limited memory and CPU.


Please try the attached patch.


Sorry, please disregard.
I should have compiled it before posting it...

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] EPG not purged if -E- option set

2013-08-31 Thread Klaus Schmidinger

On 31.08.2013 11:06, Dave wrote:

I run VDR 2.0.2 on a Raspberry Pi. The device runs continuously, so to avoid 
wearing out the SD card or needlessly spinning-up the USB disk drive I run VDR 
with the -E- option to prevent saving the EPG every 10 minutes.

Today I created a timer for one programme in a long-running series and was 
surprised to find that the Series Link plugin had scheduled timers for earlier 
episodes, some broadcast several weeks ago! These timers were then 
automatically deleted of course.

Looking at the code, it seems that cleaning up the EPG schedules is a 
side-effect of writing the data file, so the -E- option disables both. Having 
the EPG grow unbounded is perhaps not desirable on devices such as the 
Raspberry Pi which have limited memory and CPU.


Please try the attached patch. This one does compile ;-).

Klaus
--- epg.c	2013/08/23 10:46:33	3.1
+++ epg.c	2013/08/31 13:21:09
@@ -1140,16 +1140,19 @@
 class cEpgDataWriter : public cThread {
 private:
   cMutex mutex;
+  bool dump;
 protected:
   virtual void Action(void);
 public:
   cEpgDataWriter(void);
+  void SetDump(bool Dump) { dump = Dump; }
   void Perform(void);
   };
 
 cEpgDataWriter::cEpgDataWriter(void)
 :cThread(epg data writer, true)
 {
+  dump = false;
 }
 
 void cEpgDataWriter::Action(void)
@@ -1169,7 +1172,8 @@
p-Cleanup(now);
}
   }
-  cSchedules::Dump();
+  if (dump)
+ cSchedules::Dump();
 }
 
 static cEpgDataWriter EpgDataWriter;
@@ -1203,6 +1207,7 @@
 {
   free(epgDataFileName);
   epgDataFileName = FileName ? strdup(FileName) : NULL;
+  EpgDataWriter.SetDump(epgDataFileName != NULL);
 }
 
 void cSchedules::SetModified(cSchedule *Schedule)
@@ -1217,12 +1222,10 @@
  lastDump = 0;
   time_t now = time(NULL);
   if (now - lastDump  EPGDATAWRITEDELTA) {
- if (epgDataFileName) {
-if (Force)
-   EpgDataWriter.Perform();
-else if (!EpgDataWriter.Active())
-   EpgDataWriter.Start();
-}
+ if (Force)
+EpgDataWriter.Perform();
+ else if (!EpgDataWriter.Active())
+EpgDataWriter.Start();
  lastDump = now;
  }
 }
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] EPG not purged if -E- option set

2013-08-31 Thread Dave Pickles

On 31/08/13 14:22, Klaus Schmidinger wrote:

Please try the attached patch. This one does compile ;-).

Klaus


I'll leave the patched version running for a while to check that expiry 
is working. Many thanks.


Dave


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr