"Recently watched" recordings playback filter

What would you like to see in MythTV and why? Find others who might want to help implement your ideas!
Forum rules
Please be reasonable and positive with your feature requests, remember that all contributions to MythTV are by volunteers in their spare time. MythTV won't support piracy in any form, including torrents and use of soft cams, so to avoid embarrassment please do not ask.

* One suggestion per thread please. Do not post new suggestions in replies. *
Post Reply
User avatar
warpme
Translator
Posts: 63
Joined: Fri Feb 07, 2014 9:13 pm
Poland

"Recently watched" recordings playback filter

Post by warpme » Mon May 12, 2014 2:59 pm

Hi,
I have pvr function usage scenario where user having 2000+ recordings and hasn't daily time to watch i.e. full recorded movie from week ago.
By this, movie is watched in multiple shorter sessions and for every session user has to find in his 2000+ recordings list this desired movie.
It will be good to have another entry in recording filters called i.e. "Recently watched", where MythTV will present list of recently watched recordings.
It will be nice to have possibility to define sort order: start with newest, start with oldest, start with mostly progressed, start with least progressed.
br

User avatar
rwagner
Developer
Posts: 217
Joined: Thu Feb 06, 2014 11:37 pm
United States of America

Re: "Recently watched" recordings playback filter

Post by rwagner » Mon May 12, 2014 3:08 pm

Is there no filter to show recordings with bookmarks?

User avatar
stuartm
Developer
Posts: 129
Joined: Wed Feb 05, 2014 5:17 pm
Great Britain

Re: "Recently watched" recordings playback filter

Post by stuartm » Mon May 26, 2014 8:01 pm

No there isn't, but it wouldn't be hard to add. I make no promises, but I'll try to keep this one in mind.

User avatar
dizygotheca
Developer
Posts: 267
Joined: Wed Sep 03, 2014 9:02 am
Great Britain

Re: "Recently watched" recordings playback filter

Post by dizygotheca » Sat Jun 11, 2016 2:34 pm


PhilB
Senior
Posts: 227
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: "Recently watched" recordings playback filter

Post by PhilB » Fri Jun 17, 2016 12:52 pm

I have a rather crude and dirty system which shows the last three recordings viewed when I press a key on the remote, but it isn't integrated with the menu system.

The system events are used to log things viewed, expired or deleted:
Playback started is set to: /use/bin/logwatched.sh P %FILE% %TITLE%
and Recording Expired to: /use/bin/logwatched.sh E %FILE% %TITLE%

I also have Recording deleted set to: /use/bin/logwatched.sh D %FILE% %TITLE%
but that's a development hangover!

logwatched.sh is this:

Code: Select all

#!/bin/bash
#log watched and delete system events
echo "$(date +%F" "%T);$1;$2;$3 $4 $5 $6 $7 $8 $9">>/var/log/mythtv/watch.log
That creates a flat file with all three events in chronological order.

I then have the 'audio' key on my remote programmed in ~/.lirc/mythtv

Code: Select all

begin
    remote = mceusb
    prog = irexec
    button = KEY_AUDIO
    config = /usr/bin/notify.pl 192.168.1.67 
    repeat = 0
    delay = 0
end
That triggers a script notify.pl which puts a display on the screen.

Code: Select all

#!/usr/bin/perl -w
use strict;

#
# put message on frontend screen showing recently watched recordings.
# call with FE address
#

my %watched;
my $count=1;

open FH, "</var/log/mythtv/watch.log" or die;
while (<FH>){
    chomp;      
    my ($date, $action, $file, @title)=split /;/, $_;
    my $title=join (';', @title);
    $title =~ s/\s+$//;  #chop trailing spaces
    ($action eq 'E') || ($action eq 'P') || next;
    $watched{$file}{date}=$date;
    $watched{$file}{title}=$title;
    $watched{$file}{sort}=$count++;
    ($action eq 'E') &&($watched{$file}{sort}=-1);
}
close FH;

my @sorted= sort  {$watched{$b}{sort} <=> $watched{$a}{sort}} keys %watched;

#now pick out most recent
$count=0;
my @final;
while ($count<10){
    $_=$sorted[$count++];
   ($watched{$_}{sort}<0) && last;
    /_(\d{4})(\d{2})(\d{2})/;
    push @final, "$1_$2_$3  $watched{$_}{title}";
}

#now print/display them
if (&interactive){
    $_=join "\n", @final;
    print "$_\n";
}else{
    #only 3 get shown.  ??
    $_= "'" . join ("\n", @final) . "'";
    system "mythutil --message --message_text $_ --timeout 5 --bcastaddr $1";
}

exit 0;

sub interactive {
    return -t STDIN && -t STDOUT;
}
Unfortunately, only the first three get shown!

Have fun
Phil

Post Reply