summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Ahrenberg <Rolf.Ahrenberg@sci.fi>2011-02-18 20:35:29 +0200
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2011-02-18 22:50:32 +0100
commit19dedfa5c5318dc9c2824a859a2bd0395766e96c (patch)
tree9364f28602b5b9e0aec1c3a2055f8a16cfbb9e1f
parent761c046a7fb2d495097bdc0455b78925a0f4959b (diff)
downloadvdr-plugin-live-19dedfa5c5318dc9c2824a859a2bd0395766e96c.tar.gz
vdr-plugin-live-19dedfa5c5318dc9c2824a859a2bd0395766e96c.tar.bz2
Added Perl compatible regular expression filtering into the recordings menu.
-rw-r--r--Makefile2
-rw-r--r--README2
-rw-r--r--pages/recordings.ecpp13
3 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a6602db..e9fe05e 100644
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,8 @@ TNTVERS7 = $(shell ver=$(TNTVERSION); if [ $$ver -ge "1606" ]; then echo "yes"
CXXFLAGS += $(shell tntnet-config --cxxflags)
LIBS += $(shell tntnet-config --libs)
+CXXFLAGS += $(shell pcre-config --cflags)
+LIBS += $(shell pcre-config --libs-cpp)
### The name of the distribution archive:
diff --git a/README b/README
index 642af84..5372ee9 100644
--- a/README
+++ b/README
@@ -55,7 +55,7 @@ VDR >= 1.4.0-2
gcc >= 3.1
if gcc < 4.0:
boost >= 1.32.0 - http://www.boost.org
-
+PCRE >= 8.0 - http://www.pcre.org/
Tntnet >= 1.5.3 - http://www.tntnet.org/download.hms
Cxxtools >= 1.4.3 - http://www.tntnet.org/download.hms
diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp
index f256a0b..48455dd 100644
--- a/pages/recordings.ecpp
+++ b/pages/recordings.ecpp
@@ -1,5 +1,6 @@
<%pre>
#include <string>
+#include <pcrecpp.h>
#include <vdr/plugin.h>
#include <vdr/config.h>
@@ -25,6 +26,7 @@ using namespace std;
string sort;
string todel;
string diskinfo;
+ string filter;
string deletions[];
</%args>
<%session scope="global">
@@ -103,10 +105,13 @@ if (!deleteResult.empty()) {
<form method="post" name="recordings" action="recordings.ecpp">
<div class="recordings">
<ul class="recordingslist" style="display: block;">
-<& recordings.recordings_item &>
+<& recordings.recordings_item filter=(filter) &>
</ul>
</div>
- <div class="withmargin"><button class="red" type="submit"><$ tr("Delete selected") $></button></div>
+ <div class="withmargin">
+ <button class="red" type="submit"><$ tr("Delete selected") $></button>
+ <input class="withmargin" type="text" name="filter" value="<$ filter $>" id="filter"/>
+ </div>
</form>
<%cpp>
}
@@ -120,6 +125,7 @@ if (!deleteResult.empty()) {
<%def recordings_item>
<%args>
+ filter;
path[];
int level = 0;
</%args>
@@ -156,6 +162,7 @@ for (recIter = recItems.begin(); recIter != recItems.end(); ++recIter) {
}
recItemParams.add("path", recItem->Name());
recItemParams.add("level", lexical_cast<string, int>(level + 1));
+ recItemParams.add("filter", filter);
</%cpp>
<ul class="recordingslist" style="display: none;">
<%cpp>
@@ -189,11 +196,13 @@ for (recIter = recItems.begin(); recIter != recItems.end(); ++recIter) {
string duration(LiveSetup().GetShowRecDuration() ? FormatDuration(tr("(%d')"), recItem->Duration()) : "");
string shortDescr(recItem->RecInfo()->ShortText() ? recItem->RecInfo()->ShortText() : "");
string hint(tr("Click to view details.")); if (!shortDescr.empty()) hint = shortDescr + "<br />" + hint;
+ if (filter.empty() || pcrecpp::RE(filter.c_str(), pcrecpp::UTF8()).PartialMatch(recItem->Name()) || pcrecpp::RE(filter.c_str(), pcrecpp::UTF8()).PartialMatch(shortDescr)) {
</%cpp>
<li class="recording">
<& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) duration=(duration) hint=(hint) shortDescr=(shortDescr) archived=(RecordingsManager::GetArchiveDescr(recItem->Recording())) &>
</li>
<%cpp>
+ }
}
</%cpp>
</%def>