From: E.Smith <31170571+azlm8t@users.noreply.github.com>
Date: Tue, 5 Dec 2017 02:07:01 +0000 (+0000)
Subject: ui: Add tickbox for 'new programmes only'. (#1167).
X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8daa5085faabced2c3005fd3badaa56c9148d971;p=thirdparty%2Ftvheadend.git
ui: Add tickbox for 'new programmes only'. (#1167).
Issue: #1167.
---
diff --git a/src/api/api_epg.c b/src/api/api_epg.c
index 60847c5d7..f12d55ebe 100644
--- a/src/api/api_epg.c
+++ b/src/api/api_epg.c
@@ -343,6 +343,7 @@ api_epg_grid
if (str)
eq.stitle = strdup(str);
eq.fulltext = htsmsg_get_bool_or_default(args, "fulltext", 0);
+ eq.new_only = htsmsg_get_bool_or_default(args, "new", 0);
str = htsmsg_get_str(args, "channel");
if (str)
eq.channel = strdup(str);
diff --git a/src/epg.c b/src/epg.c
index 9977f5784..e4ce0d3c2 100644
--- a/src/epg.c
+++ b/src/epg.c
@@ -2949,6 +2949,10 @@ _eq_add ( epg_query_t *eq, epg_broadcast_t *e )
}
if (!r) return;
}
+ if (eq->new_only) {
+ if (!e->is_new)
+ return;
+ }
if (fulltext) {
if ((s = epg_episode_get_title(ep, lang)) == NULL ||
regex_match(&eq->stitle_re, s)) {
diff --git a/src/epg.h b/src/epg.h
index 7ce6a4205..da2de66a4 100644
--- a/src/epg.h
+++ b/src/epg.h
@@ -692,6 +692,7 @@ typedef struct epg_query {
char *stitle;
tvh_regex_t stitle_re;
int fulltext;
+ int new_only;
char *channel;
char *channel_tag;
uint32_t genre_count;
diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js
index 76ba7ee01..b7b8327ef 100644
--- a/src/webui/static/app/epg.js
+++ b/src/webui/static/app/epg.js
@@ -748,6 +748,10 @@ tvheadend.epg = function() {
width: 20
});
+ var epgFilterNewOnly = new Ext.form.Checkbox({
+ width: 20
+ });
+
// Channels, uses global store
var epgFilterChannels = new Ext.form.ComboBox({
@@ -907,6 +911,11 @@ tvheadend.epg = function() {
epgFilterFulltext.setValue(0);
};
+ clearNewOnlyFilter = function() {
+ delete epgStore.baseParams.newOnly;
+ epgFilterNewOnly.setValue(0);
+ }
+
clearChannelFilter = function() {
delete epgStore.baseParams.channel;
epgFilterChannels.setValue("");
@@ -937,6 +946,7 @@ tvheadend.epg = function() {
clearModeFilter();
clearTitleFilter();
clearFulltextFilter();
+ clearNewOnlyFilter();
clearChannelFilter();
clearChannelTagsFilter();
clearDurationFilter();
@@ -1030,6 +1040,13 @@ tvheadend.epg = function() {
}
});
+ epgFilterNewOnly.on('check', function(c, value) {
+ if (epgStore.baseParams.new !== value) {
+ epgStore.baseParams.new = value;
+ epgView.reset();
+ }
+ });
+
var epgView = new Ext.ux.grid.livegrid.GridView({
nearLimit: 100,
loadMask: {
@@ -1054,7 +1071,7 @@ tvheadend.epg = function() {
var tbar = [
epgMode, '-',
- epgFilterTitle, { text: _('Fulltext') }, epgFilterFulltext, '-',
+ epgFilterTitle, { text: _('Fulltext') }, epgFilterFulltext, { text: _('New only') }, epgFilterNewOnly, '-',
epgFilterChannels, '-',
epgFilterChannelTags, '-',
epgFilterContentGroup, '-',
@@ -1232,6 +1249,9 @@ tvheadend.epg = function() {
var fulltext = epgStore.baseParams.fulltext ?
" (" + _("Fulltext") + ")"
: "";
+ var newOnly = epgStore.baseParams.new ?
+ " (" + _("New only") + ")"
+ : "";
var channel = epgStore.baseParams.channel ?
tvheadend.channelLookupName(epgStore.baseParams.channel)
: "" + _("Don't care") + "";
@@ -1254,7 +1274,7 @@ tvheadend.epg = function() {
Ext.MessageBox.confirm(_('Auto Recorder'), _('This will create an automatic rule that '
+ 'continuously scans the EPG for programs '
+ 'to record that match this query') + ': ' + '
'
- + '