summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2018-03-07 16:34:09 (GMT)
committerhorchi <vdr@jwendel.de>2018-03-07 16:34:09 (GMT)
commit210fdcee369cf735d00273e88e758ad754344474 (patch)
treea9d1ab4cb8e5077bb002d9f6256a1d03562a7556
parentd9d90f03128c531cd0b93cebca2af5660c2d4322 (diff)
downloadvdr-plugin-epg2vdr-210fdcee369cf735d00273e88e758ad754344474.tar.gz
vdr-plugin-epg2vdr-210fdcee369cf735d00273e88e758ad754344474.tar.bz2
2018-03-07 version 1.1.92 (horchi)\n - added: create of local switch timrt even when a 'recording' timer exists\n\n1.1.92
-rw-r--r--HISTORY.h7
-rw-r--r--menu.c17
-rw-r--r--menu.h3
-rw-r--r--menusched.c29
-rw-r--r--po/de_DE.po2
5 files changed, 40 insertions, 18 deletions
diff --git a/HISTORY.h b/HISTORY.h
index c1b5d76..3e014ec 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -5,8 +5,8 @@
*
*/
-#define _VERSION "1.1.91"
-#define VERSION_DATE "26.02.2018"
+#define _VERSION "1.1.92"
+#define VERSION_DATE "07.03.2018"
#define DB_API 6
@@ -19,6 +19,9 @@
/*
* ------------------------------------
+2018-03-07 version 1.1.92 (horchi)
+ - added: create of local switch timrt even when a 'recording' timer exists
+
2018-02-26 version 1.1.91 (horchi)
- change: backward compatibility to vdr 2.2.0 - another step
diff --git a/menu.c b/menu.c
index d563009..a9360dd 100644
--- a/menu.c
+++ b/menu.c
@@ -550,7 +550,7 @@ int cMenuDb::initUserTimes()
// Lookup Timer
//***************************************************************************
-int cMenuDb::lookupTimer(const cEvent* event, int& timerMatch, int& remote, int force)
+int cMenuDb::lookupTimer(const cEvent* event, int& timerMatch, int& remote, char& type, int force)
{
int maxSp = 0;
@@ -583,6 +583,7 @@ int cMenuDb::lookupTimer(const cEvent* event, int& timerMatch, int& remote, int
info->timerid = timerDb->getValue("ID")->getIntValue();
info->state = timerDb->getValue("STATE")->getCharValue();
+ info->type = timerDb->getValue("TYPE")->getCharValue();
info->starttime = valueStartTime.getIntValue();
info->eventid = timerDb->getIntValue("EVENTID");
strcpy(info->channelid, timerDb->getStrValue("CHANNELID"));
@@ -602,14 +603,16 @@ int cMenuDb::lookupTimer(const cEvent* event, int& timerMatch, int& remote, int
{
remote = strcmp(ifo->uuid, Epg2VdrConfig.uuid) != 0;
timerMatch = tmFull;
+ type = ifo->type;
return ifo->timerid;
}
else if (strcmp(ifo->channelid, event->ChannelID().ToString()) == 0
- && ifo->starttime == event->StartTime()) // #TODO around
+ && ifo->starttime == event->StartTime()) // #TODO? also around this time
{
remote = strcmp(ifo->uuid, Epg2VdrConfig.uuid) != 0;
timerMatch = tmFull;
+ type = ifo->type;
return ifo->timerid;
}
}
@@ -724,16 +727,20 @@ int cMenuDb::createSwitchTimer(const cEvent* event)
{
int timerMatch = tmNone;
int remote = no;
+ char type;
- // alredy or nearly started?
+ // already or nearly started?
if (!event || event->StartTime() <= time(0)+tmeSecondsPerMinute)
return done;
// already created?
- if (lookupTimer(event, timerMatch, remote))
- return done;
+ if (lookupTimer(event, timerMatch, remote, type))
+ {
+ if (!remote && type == ttView)
+ return done;
+ }
cDbRow* timerRow = newTimerRowFromEvent(event);
diff --git a/menu.h b/menu.h
index e00079b..6912c28 100644
--- a/menu.h
+++ b/menu.h
@@ -70,7 +70,7 @@ class cMenuDb : public cParameters
int initUserTimes();
int initUserList(char**& userList, int& count, long int& loginEnabled);
- int lookupTimer(const cEvent* event, int& timerMatch, int& remote, int force = no);
+ int lookupTimer(const cEvent* event, int& timerMatch, int& remote, char& type, int force = no);
// timer db
@@ -146,6 +146,7 @@ class cMenuDb : public cParameters
uint timerid;
char state;
+ char type;
time_t starttime;
uint eventid;
char channelid[100];
diff --git a/menusched.c b/menusched.c
index c343fdb..65437aa 100644
--- a/menusched.c
+++ b/menusched.c
@@ -107,6 +107,7 @@ cMenuEpgMatchRecordings::cMenuEpgMatchRecordings(cMenuDb* db, const cEvent* even
: cOsdMenu(tr("Matching recordings"), 30, 30, 30, 40)
{
cMenuDb* menuDb = db;
+ std::map<std::string,bool> directMatches;
Add(new cOsdItem(tr("Direct Matches:")));
cList<cOsdItem>::Last()->SetSelectable(no);
@@ -135,6 +136,8 @@ cMenuEpgMatchRecordings::cMenuEpgMatchRecordings(cMenuDb* db, const cEvent* even
vdr = menuDb->vdrDb->getStrValue("NAME");
}
+ directMatches[menuDb->vdrDb->getStrValue("MD5PATH")] = yes;
+
Add(new cEpgMenuTextItem(menuDb->recordingListDb->getStrValue("MD5PATH"),
cString::sprintf("%s%s%s\t%s\t%s/%s", vdr ? vdr : "", vdr ? "\t" : "",
menuDb->recordingListDb->getStrValue("TITLE"),
@@ -169,12 +172,17 @@ cMenuEpgMatchRecordings::cMenuEpgMatchRecordings(cMenuDb* db, const cEvent* even
vdr = menuDb->vdrDb->getStrValue("NAME");
}
- Add(new cEpgMenuTextItem(menuDb->recordingListDb->getStrValue("MD5PATH"),
- cString::sprintf("%s%s%s\t%s\t%s/%s", vdr ? vdr : "", vdr ? "\t" : "",
- menuDb->recordingListDb->getStrValue("TITLE"),
- menuDb->recordingListDb->getStrValue("SHORTTEXT"),
- menuDb->recordingListDb->getStrValue("FOLDER"),
- menuDb->recordingListDb->getStrValue("NAME"))));
+ auto it = directMatches.find(menuDb->vdrDb->getStrValue("MD5PATH"));
+
+ if (it == directMatches.end())
+ {
+ Add(new cEpgMenuTextItem(menuDb->recordingListDb->getStrValue("MD5PATH"),
+ cString::sprintf("%s%s%s\t%s\t%s/%s", vdr ? vdr : "", vdr ? "\t" : "",
+ menuDb->recordingListDb->getStrValue("TITLE"),
+ menuDb->recordingListDb->getStrValue("SHORTTEXT"),
+ menuDb->recordingListDb->getStrValue("FOLDER"),
+ menuDb->recordingListDb->getStrValue("NAME"))));
+ }
}
menuDb->selectRecordingForEventByLv->freeResult();
@@ -251,9 +259,10 @@ bool cMenuEpgScheduleItem::Update(bool Force)
bool result = false;
int oldTimerMatch = timerMatch;
int remote = no;
+ char type;
if (event)
- menuDb->lookupTimer(event, timerMatch, remote); // -> loads timerDb, vdrDb and set ther timerMatch
+ menuDb->lookupTimer(event, timerMatch, remote, type); // -> loads timerDb, vdrDb and set ther timerMatch
if (Force || timerMatch != oldTimerMatch)
{
@@ -550,10 +559,11 @@ eOSState cMenuEpgEvent::ProcessKey(eKeys Key)
const cEvent* e = getNextPrevEvent(event, Key == kGreen ? -1 : +1);
int remote = no;
int timerMatch = tmNone;
+ char type;
// get remote and timerMatch info
- menuDb->lookupTimer(e, timerMatch, remote);
+ menuDb->lookupTimer(e, timerMatch, remote, type);
setEvent(e, timerMatch);
return osContinue;
@@ -1010,12 +1020,13 @@ eOSState cMenuEpgWhatsOn::Record()
cEpgTimer* timer = 0;
long timerid = 0;
int remote = no;
+ char type;
cMenuEpgScheduleItem* item = (cMenuEpgScheduleItem*)Get(Current());
if (!item)
return osContinue;
- if ((timerid = menuDb->lookupTimer(item->event, timerMatch, remote))) // -> loads timerDb and vdrDb
+ if ((timerid = menuDb->lookupTimer(item->event, timerMatch, remote, type))) // -> loads timerDb and vdrDb
{
menuDb->timerDb->clear();
menuDb->timerDb->setValue("ID", timerid);
diff --git a/po/de_DE.po b/po/de_DE.po
index 8f572df..7a00e43 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -185,7 +185,7 @@ msgid "Switch Timer"
msgstr ""
msgid "Matching recordings"
-msgstr "Vergleiche Aufnahmen"
+msgstr "Vorhandene Aufnahmen"
msgid "Direct Matches:"
msgstr "Direkte √úbereinstimmungen:"