[mythtv] [PATCH] Add checkbox to list only unwatched recordings
Philipp Matthias Hahn
pmhahn+mythtv at pmhahn.de
Sat Sep 30 16:52:03 UTC 2017
I only like to see the recordings I have not yet watched, so add a
checkbox to filter them out by default and to re-enable showing even
watched recordings.
---
modules/_shared/lang/English.lang | 1 +
modules/_shared/lang/German.lang | 2 ++
modules/tv/recorded.php | 4 ++++
modules/tv/tmpl/default/recorded.php | 1 +
4 files changed, 8 insertions(+)
diff --git a/modules/_shared/lang/English.lang b/modules/_shared/lang/English.lang
index 3cfd73d6..822f7984 100644
--- a/modules/_shared/lang/English.lang
+++ b/modules/_shared/lang/English.lang
@@ -944,3 +944,4 @@
"Yesterday"
"You are missing a php extension for mysql interaction. Please install php-mysqli or similar"
"You must be running at least php 5.3 to use this program."
+"Seen"
diff --git a/modules/_shared/lang/German.lang b/modules/_shared/lang/German.lang
index 405f4564..da42ed99 100644
--- a/modules/_shared/lang/German.lang
+++ b/modules/_shared/lang/German.lang
@@ -1643,3 +1643,5 @@
Die PHP-Erweiterung für MySQL ist nicht installiert. Bitte installieren sie php-mysqli or ähnliches
"You must be running at least php 5.3 to use this program."
Es ist mindestens PHP 5.3 zur Ausführung dieses Programms nötig.
+"Seen"
+ Gesehene
diff --git a/modules/tv/recorded.php b/modules/tv/recorded.php
index 70c04359..d66ead31 100644
--- a/modules/tv/recorded.php
+++ b/modules/tv/recorded.php
@@ -96,6 +96,8 @@
if ($_REQUEST['title'] && $_REQUEST['title'] != $record[0])
continue;
if ($_REQUEST['recgroup'] && $_REQUEST['recgroup'] != $record[30])
+ continue;
+ if (!$_REQUEST['seen'] && ($record[29] & 0x00000200))
continue;
// Hide LiveTV recordings from the default view
if (empty($_REQUEST['recgroup']) && ($record[30] == 'LiveTV' || $record[30] == 'Deleted'))
@@ -162,6 +164,8 @@
$_SESSION['recorded_title'] = $_REQUEST['title'];
if (isset($_REQUEST['recgroup']))
$_SESSION['recorded_recgroup'] = $_REQUEST['recgroup'];
+ if (isset($_REQUEST['unwatched']))
+ $_SESSION['unwatched'] = $_REQUEST['unwatched'];
// The default sorting choice isn't so good for recorded programs, so we'll set our own default
if (!is_array($_SESSION['recorded_sortby']) || !count($_SESSION['recorded_sortby']))
diff --git a/modules/tv/tmpl/default/recorded.php b/modules/tv/tmpl/default/recorded.php
index 8502305b..6724a8bb 100644
--- a/modules/tv/tmpl/default/recorded.php
+++ b/modules/tv/tmpl/default/recorded.php
@@ -73,6 +73,7 @@
}
?>
</select></td>
+ <td><input type="checkbox" name="seen" id="seen" value="1" onchange="$('change_title').submit()" <?php if ($_REQUEST['seen']) echo ' CHECKED' ?>/><label for="seen"><?php echo t('Seen') ?></label></td>
</tr>
</table>
</form>
--
2.14.2
More information about the mythtv-dev
mailing list