Opened 8 years ago

Closed 5 years ago

#12809 closed Patch - Feature (Abandoned)

Use lastPlayPos rather than bookmark

Reported by: Roger Siddons Owned by: Roger Siddons
Priority: minor Milestone: 30.0
Component: MythTV - Video Playback Version: Master Head
Severity: low Keywords:
Cc: Ticket locked: no

Description

This patch offers a solution to https://forum.mythtv.org/viewtopic.php?f=9&t=163 '"Recently watched" recordings playback filter' requesting a way of locating part-played recordings more easily.

It involves the last-played position introduced by #11713 and Watchlist changes from #12296. Most importantly, it alters bookmarking behaviour to separate last-play position from 'user marks'.

As the changes are connected, they are presented together - 18 commits have been aggregated into 2 mega-patches for convenience, but I can easily push a branch if it helps.

Summary:

  1. Last-played position is re-enabled and becomes exclusive indicator of playback position. Video Library and the preview generator also use it.
  2. Bookmarks become a user feature only and are never set/cleared automatically. 2 related settings are removed.
  3. Buttonlist items gain a progressbar widget and progress percentage value. 'Watch Recordings' uses this to show the playback position; 'Upcoming Recordings' uses it to show a (proxy) recording progress. See screenshots.
  4. The Watchlist promotes part-watched recordings to the top.
  5. Introduces a Myth-compatible QtConcurrent feature for conveniently running background threads.

These patches are fully revertable. However you will lose the last-played position of all part-played recordings/videos that were played whilst the patches were installed (because bookmark won't be set). Manually bookmark them first before reverting.

1. Extend lastPlayPos

Last-played position was disabled by 38443b8e (the menu option to resume playback never appears). It is re-enabled for recordings and videos.

As it duplicates (betters) the bookmark's 'save position on exit' function, this mark assumes that responsibility and is also updated on playback exit (provided playback has been going for at least 30 sec). At end of recording it is reset.

Note: 'Automatically Mark watched' is now also actioned by the end-of-playback dialog (unnoticed bug: it isn't currently).

By default, playback now starts from:

  • last-played position, if present
  • bookmark, if present (so user can override program start mark)
  • program start mark, if present (recordings only)
  • beginning of file

Menu options allow user to start from last-played position, bookmark or 'beginning' (program start mark or file start) where applicable. Menu options allow user to clear bookmark and reset last-played position.

This mark always indicates playback position (whereas bookmark may not) and so can be used to identify part-played recordings/videos.

Previews are now generated from:

  • last-played position, if present
  • bookmark, if present,
  • program start mark, if present
  • existing offset calculation, which is unchanged.

Possibly the latter two should be combined to 'x minutes from program start'

2. Simplify bookmarks

Bookmarks have always been confusing because they try to do (at least) 2 functions: mark last-played point or mark a user-designated point, i.e. program start or a point of interest.

This depends on 2 settings "Clear bookmark on playback" & "Action on playback exit/Save position and exit".

Either the user must remember to manually bookmark before exiting an unfinished show or forego the ability to mark anything (because Myth will overwrite it on exit).

By losing the last-play-point responsibility the bookmark becomes purely a user aid - it will never be automatically updated/cleared.

The 2 settings are now redundant and have been removed from the UI.

An example of the benefit: If my kids have part-watched a show I can resume playback, bookmark it, then rewind to watch from the beginning, exiting/resuming as I often as I wish. When I've finished it (their) next playback will resume from the bookmark automatically. Or I could jump-to-bookmark and leave the last-played-pos in its original location to retain the part-played indication.

Some menu options "Set last-play-pos to bookmark" and "Swap bookmark/last-play-pos" could prove useful to allow 2 people to part-watch shows simultaneously.

Although not ideal, it's an improvement (until user-assignable bookmarks get implemented)

3. Add UI

Buttonlist buttons can now contain a progressbar, as an intuitive way to show contextual 'progress'.

'Watch Recordings' uses it to show playback posiiton. Previews aren't regenerated whilst a file is in use, so playback by another frontend only updates the progress bar/counter, until playback ceases.

'Upcoming Recordings' uses the bar to show the progress of time for recordings - it will progress to 100% for failing (0-byte) recordings. Filesize is also available for 'Upcoming Recordings' now (although Scheduler Updates will reset it to 0.00 for 10 secs)

A percentage progress value is also provided that can be used for sorting, or as a "depends" for a 'part-watched' icon.

The modified MythCenter-Wide theme demonstrates the UI changes (in a cluttered and ugly way) by using the button background as a progress bar. Themers can do a better job.

Video Library has no UI indication of progress.

4. Show part-played shows

Whilst a 'Recently Watched' filter would be useful, it should probably include more than part-played recordings.

Sorting is of dubious benefit. If there are so many part-played recordings then the user is unlikely to select one based on playback positiion!

The important point is to list part-played recordings separately. As dekarl noted, this feature is a better fit for the Watchlist. An updated version of the Watchlist #12296 promotes part-watched to the top of the list.

Note that #12287 is useful for switching between the watchlist and 'all episodes'.

5. Convenience thread-runner

QtConcurrent::Run is a useful way of running verbiage-free background threads. I use it often in Myth without problem.

However, strictly it is incompatible with Myth because MThreadPool is not a subclass of QThreadPool. I can't find any evidence to justify this, but include a tailored version of QtConcurrent::Run that uses MThreadPool.

Attachments (6)

watch.jpg (584.6 KB) - added by Roger Siddons 8 years ago.
Part-played recordings always appear at top of Watchlist
upcoming.jpg (337.0 KB) - added by Roger Siddons 8 years ago.
Active recordings (proxy) progress
0001-Use-lastPlayPos-instead-of-bookmark.patch (81.4 KB) - added by Roger Siddons 8 years ago.
0002-Watchlist-with-lastPlayPos.patch (56.1 KB) - added by Roger Siddons 8 years ago.
0003-Add-Unfinished-recording-filter.patch (9.8 KB) - added by Roger Siddons 8 years ago.
20180111_endoffile.patch (599 bytes) - added by Peter Bennett 6 years ago.
Fix for end of file looping

Download all attachments as: .zip

Change History (16)

Changed 8 years ago by Roger Siddons

Attachment: watch.jpg added

Part-played recordings always appear at top of Watchlist

Changed 8 years ago by Roger Siddons

Attachment: upcoming.jpg added

Active recordings (proxy) progress

comment:1 Changed 8 years ago by Roger Siddons

Updated patches that will apply cleanly to e7deca28. Also adds a recording filter

Changed 8 years ago by Roger Siddons

Changed 8 years ago by Roger Siddons

Changed 8 years ago by Roger Siddons

comment:2 Changed 7 years ago by Roger Siddons

Milestone: unknown29.0
Status: newassigned

comment:3 Changed 7 years ago by Peter Bennett

Roger

Why don't you commit the change, and changes in other tickets (#12296, #12683, others)? Your changes look really useful.

Peter

comment:4 Changed 7 years ago by Roger Siddons

Atm it breaks Services clients (Kodi) as they have no way of retrieving the lastplaypos. I've been waylaid with other stuff so haven't had a chance to test it all yet. And #12296 has become dependent on this one.

I'll move them to 29.1 once the milestone appears.

comment:5 Changed 6 years ago by Stuart Auchterlonie

Milestone: 29.029.1

comment:6 Changed 6 years ago by Peter Bennett

Roger

Can I help with getting your patches in? I suggest applying them to master, rather than 29.1 as you had suggested.

Regarding a service that can support the last played position. There are at the moment services GetSavedBookmark and SetSavedBookmark. I could add GetLastPlayPos and SetLastPlayPos for Kodi and others to use. It is time for me to learn about the MythTV services, so if you agree I can get going on that so that we can commit this stuff.

Also there are some small changes in Piotr's version of the patches, which probably should also be included.

Peter

comment:7 Changed 6 years ago by Peter Bennett

The attached patch, endoffile.patch, fixes a bug.

What is happening is when you reach the end of a playback and the prompt occurs "End of Recording" with options "delete but allow to re-record", "delete", "save it so I can watch it again", the decoder goes into a loop displaying many error messages "Unknown error". This is not visible to the viewer but it fills the log with those messages. These continue filling the log until the user selects one of those options. This bug exists even without the patches from this ticket. This only happens on master, not on V29.

If you select "save it so I can watch it again" the program is left with playback position at 97% and thus it remains on the "Unfinished" List.

The patch solves these issues.

Last edited 6 years ago by Peter Bennett (previous) (diff)

Changed 6 years ago by Peter Bennett

Attachment: 20180111_endoffile.patch added

Fix for end of file looping

comment:8 Changed 6 years ago by Peter Bennett

I am abandoning 20180111_endoffile.patch, as I no longer get the error. I had experienced the error for several days while testing this ticket patches. I then tested on multiple recordings with and without this ticket patches and it occurred every time. Now I cannot get the error to occur with any recording on any version. If I get the error again or anybody reports it I will revisit this.

comment:9 Changed 6 years ago by Roger Siddons

Milestone: 29.130.0

comment:10 Changed 5 years ago by dizygotheca

Resolution: Abandoned
Status: assignedclosed

This is too big. Accomodating existing bookmark use is tricky and too much code has changed.

Note: See TracTickets for help on using tickets.