summaryrefslogtreecommitdiff
path: root/views/displaymenudetailview.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-10-11 10:39:41 +0200
committerlouis <louis.braun@gmx.de>2014-10-11 10:39:41 +0200
commiteffc63e8104e3331337dcc52d2506938f1871e07 (patch)
tree611fa408385131f55662a65434bdc8bdce155aec /views/displaymenudetailview.c
parent7fbcc9d3306260fda407111f46b46097f3fa7eca (diff)
downloadvdr-plugin-skindesigner-effc63e8104e3331337dcc52d2506938f1871e07.tar.gz
vdr-plugin-skindesigner-effc63e8104e3331337dcc52d2506938f1871e07.tar.bz2
added setup options to configure rerun display behaviour
Diffstat (limited to 'views/displaymenudetailview.c')
-rw-r--r--views/displaymenudetailview.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/views/displaymenudetailview.c b/views/displaymenudetailview.c
index e87c0bb..35a34ac 100644
--- a/views/displaymenudetailview.c
+++ b/views/displaymenudetailview.c
@@ -425,16 +425,18 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
if (isempty(event->Title()))
return false;
-
- int maxNumReruns = 10;
+
+ int maxNumReruns = config.rerunAmount;
+ int rerunDistance = config.rerunDistance * 3600;
+ int rerunNaxChannel = config.rerunMaxChannel;
Epgsearch_searchresults_v1_0 data;
string strQuery = event->Title();
- data.useSubTitle = true;
data.query = (char *)strQuery.c_str();
data.mode = 0;
data.channelNr = 0;
data.useTitle = true;
+ data.useSubTitle = true;
data.useDescription = false;
bool foundRerun = false;
@@ -444,8 +446,24 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
foundRerun = true;
int i = 0;
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < maxNumReruns; r = list->Next(r)) {
- if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime()))
+ time_t eventStart = event->StartTime();
+ time_t rerunStart = r->event->StartTime();
+ cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
+ //check for identical event
+ if ((event->ChannelID() == r->event->ChannelID()) && (eventStart == rerunStart))
continue;
+ //check for timely distance
+ if (rerunDistance > 0) {
+ if (rerunStart - eventStart < rerunDistance) {
+ continue;
+ }
+ }
+ //check for maxchannel
+ if (rerunNaxChannel > 0) {
+ if (channel && channel->Number() > rerunNaxChannel) {
+ continue;
+ }
+ }
i++;
map< string, string > rerun;
rerun.insert(pair<string, string>("reruns[title]", r->event->Title() ? r->event->Title() : ""));
@@ -460,7 +478,6 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
bool logoExists = imgCache->LogoExists(channelID);
rerun.insert(pair<string, string>("reruns[channellogoexists]", logoExists ? "1" : "0"));
- cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
if (channel) {
stringstream channelNumber;
channelNumber << channel->Number();