diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-24 15:01:50 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-24 15:01:50 +0200 |
commit | 313448ad0cd49d6f515bb53b53d6b6700b96db00 (patch) | |
tree | 6dd1f147bde949ec76f1c4327b0d92e31bfb34a4 /epg.c | |
parent | e41261ae46644e5637a888e969eba2bac632467e (diff) | |
download | vdr-313448ad0cd49d6f515bb53b53d6b6700b96db00.tar.gz vdr-313448ad0cd49d6f515bb53b53d6b6700b96db00.tar.bz2 |
Implemented 'modified' and 'seen' for EPG schedules/events1.3.14
Diffstat (limited to 'epg.c')
-rw-r--r-- | epg.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * - * $Id: epg.c 1.19 2004/05/22 12:37:07 kls Exp $ + * $Id: epg.c 1.20 2004/10/24 15:01:50 kls Exp $ */ #include "epg.h" @@ -99,6 +99,11 @@ void cEvent::SetVps(time_t Vps) vps = Vps; } +void cEvent::SetSeen(void) +{ + seen = time(NULL); +} + bool cEvent::HasTimer(void) const { for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) { @@ -478,6 +483,7 @@ cSchedule::cSchedule(tChannelID ChannelID) { channelID = ChannelID; hasRunning = false;; + modified = 0; } cEvent *cSchedule::AddEvent(cEvent *Event) @@ -496,7 +502,7 @@ const cEvent *cSchedule::GetPresentEvent(bool CheckRunningStatus) const if (!CheckRunningStatus) break; } - if (CheckRunningStatus && p->RunningStatus() >= SI::RunningStatusPausing) + if (CheckRunningStatus && time(NULL) - p->Seen() < 30 && p->RunningStatus() >= SI::RunningStatusPausing) return p; } return pe; @@ -643,6 +649,7 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules) if (!cEvent::Read(f, p)) return false; p->Sort(); + Schedules->SetModified(p); } } else { @@ -680,6 +687,7 @@ cSchedules cSchedules::schedules; const char *cSchedules::epgDataFileName = NULL; time_t cSchedules::lastCleanup = time(NULL); time_t cSchedules::lastDump = time(NULL); +time_t cSchedules::modified = 0; const cSchedules *cSchedules::Schedules(cSchedulesLock &SchedulesLock) { @@ -693,6 +701,12 @@ void cSchedules::SetEpgDataFileName(const char *FileName) epgDataFileName = strdup(FileName); } +void cSchedules::SetModified(cSchedule *Schedule) +{ + Schedule->SetModified(); + modified = time(NULL); +} + void cSchedules::Cleanup(bool Force) { if (Force) |