[gpodder] Displaying "last played position" in episodes list (Gtk)

  • From: Dov Feldstern <dovdevel@xxxxxxxxx>
  • To: gpodder@xxxxxxxxxxxxx
  • Date: Fri, 7 Feb 2014 16:06:52 +0200

Hi!

I like to have the last played position displayed in the episodes list
-- so for partially played events I want the duration to show "27:37 /
57:22", and for finished events I want the duration to be "Finished
(01:07:23)".

In order to achieve this, two small changes are required, both of
which reverse previous changes:

1. In the "duration" column, display the full get_play_info_string(),
and not just "duration_only" (this was changed to be duration only as
part of 1a813a4c);

2. When returning the get_play_info_string(), return "Finished
(##:##)" if is_finished() (this was removed in f02063be).

So, can we just reverse those previous changes? Or how to go about this change?

For reference, I'm attaching patches which achieve what I'm looking for.

Thanks!
Dov
# HG changeset patch
# User Dov Feldstern <dovdevel@xxxxxxxxx>
# Date 1391043958 -7200
#      Thu Jan 30 03:05:58 2014 +0200
# Node ID 382f06a3281d7c244b3a9c02eac093a0668eb834
# Parent  190c3c24f22349910cff4d1a711713c0da4bb707
return "Finished (##:##)" from get_play_info_string() for finished episodes

This reverts the change made in f02063beea6bbb2715bb9f84e30d3989616864aa.

diff -r 190c3c24f223 -r 382f06a3281d src/gpodder/model.py
--- a/src/gpodder/model.py      Thu Jan 30 02:47:58 2014 +0200
+++ b/src/gpodder/model.py      Thu Jan 30 03:05:58 2014 +0200
@@ -717,6 +717,8 @@
         duration = util.format_time(self.total_time)
         if duration_only and self.total_time > 0:
             return duration
+        elif self.is_finished():
+            return '%s (%s)' % (_('Finished'), duration)
         elif self.current_position > 0 and \
                 self.current_position != self.total_time:
             position = util.format_time(self.current_position)
# HG changeset patch
# User Dov Feldstern <dovdevel@xxxxxxxxx>
# Date 1391042878 -7200
#      Thu Jan 30 02:47:58 2014 +0200
# Node ID 190c3c24f22349910cff4d1a711713c0da4bb707
# Parent  8028a7192c57936940b4c76a01442030769ccf54
Gtk UI: display episode's last played position (not duration only)

diff -r 8028a7192c57 -r 190c3c24f223 src/gpodder/gtkui/model.py
--- a/src/gpodder/gtkui/model.py        Fri Feb 07 14:24:35 2014 +0200
+++ b/src/gpodder/gtkui/model.py        Thu Jan 30 02:47:58 2014 +0200
@@ -415,7 +415,7 @@
                 self.C_VIEW_SHOW_UNPLAYED, view_show_unplayed, \
                 self.C_DESCRIPTION, description, \
                 self.C_TOOLTIP, tooltip, \
-                self.C_TIME, episode.get_play_info_string(duration_only=True), 
\
+                self.C_TIME, episode.get_play_info_string(), \
                 self.C_TIME_VISIBLE, bool(episode.total_time), \
                 self.C_TOTAL_TIME, episode.total_time, \
                 self.C_LOCKED, episode.archive, \

Other related posts: