-
-
Notifications
You must be signed in to change notification settings - Fork 217
subscription_stats.py Extension #1590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Show publishing statistics for subscriptions, original from Brand Huntsman <http://qzx.com/mail/ add date for last feed update and last episode update
|
I get this error when I try to use your version of this script: I've been listening to the full archives of some podcasts, so I haven't done a full check for updates in ages. If this issue happens because gPodder has changed its timestamp format, you don't need to stress over it. |
tpikonen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, except for the few nitpicks.
|
It seems this is due to different ways python versions are treat the different locales!
|
A new version with changes from comments
|
@anewuser please try the new version 0.2 |
|
It's working now, but can you please make the columns sortable and resizable? |
|
Since you want to finish this for me, here is what kept me from releasing it, other than adding the 'last episode' column. '%s subscriptions (%d paused)' should be %d not %s. The 25 count should be clamped to Should it have a documentation link to a page in https://github.com/gpodder/gpodder.github.io/tree/master/docs/extensions? |
Done.
Sorry, can you explain better this?
Done. |
with sort columns
|
@anewuser > It's working now, but can you please make the columns sortable and resizable? Done, you can test the new version |
|
The Days column is now sorted as string, which does not work as it should with strings which are numbers (the sorting is ok on start though). One solution would be to set a custom sort function with |
|
It would be nice to be able to use the statistics dialog in also in narrow screens (i.e. phones). Here's a suggestion on how to make it shrinkable and almost borderless. Since the podcast name is set to ellipsize at the end of the string, the pause indicator is moved to the beginning and shortened to a symbol. The close button and labels are now without margins, so they should be padded separately. diff --git a/share/gpodder/extensions/subscription_stats.py b/share/gpodder/extensions/subscription_stats.py
index b1d52e31..66ab927e 100644
--- a/share/gpodder/extensions/subscription_stats.py
+++ b/share/gpodder/extensions/subscription_stats.py
@@ -44,9 +44,9 @@ class gPodderExtension:
store = Gtk.ListStore(str, str, str)
for average, name, last, paused in channels:
store.append([
('%.1f' % round(average, 1)) if average > 0 else '?',
- name if not paused else (_('%s (paused)') % name), last,
+ ('‖ ' if paused else '') + name, last,
])
tree = Gtk.TreeView(model=store)
scrolled.add(tree)
@@ -62,12 +62,14 @@ class gPodderExtension:
channelcell = Gtk.CellRendererText()
channelcell.set_property('xalign', 0)
channelcell.set_property('alignment', Pango.Alignment.LEFT)
+ channelcell.set_property('ellipsize', Pango.EllipsizeMode.END)
channelcolumn = Gtk.TreeViewColumn(_('Podcast'))
channelcolumn.set_sort_column_id(1)
channelcolumn.pack_start(channelcell, True)
channelcolumn.add_attribute(channelcell, 'text', 1)
+ channelcolumn.set_expand(True)
tree.append_column(channelcolumn)
lastcell = Gtk.CellRendererText()
lastcell.set_property('xalign', 0)
@@ -149,15 +151,16 @@ class gPodderExtension:
dlg.set_size_request(400, 400)
dlg.set_resizable(True)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
- box.set_border_width(10)
+ box.set_border_width(0)
label = Gtk.Label(_('%d subscriptions (%d paused)') % (len(channels), nr_paused))
box.add(label)
notebook = Gtk.Notebook()
notebook.set_vexpand(True)
+ notebook.set_scrollable(True)
self.add_page(notebook, _('daily'), daily)
self.add_page(notebook, _('weekly'), weekly)
self.add_page(notebook, _('monthly'), monthly)
self.add_page(notebook, _('yearly'), yearly)
|
-label = Gtk.Label(_('Average days between the last 25 episodes.'))
+label = Gtk.Label(_('Average days between the last %d episodes.') % (episode.limit if episode.limit < 25 else 25))Something like that. |
The sort of the date now works, and other changes suggested by @tpikonen and @auouymous
Done, I think the sort now works, I use another column with the epoc date and the sort is made with that column |
Ok, thanks add this change |
Add this changes, thanks |
Cosmetic changes to pass lint and test workflow
|
episode.limit was not defined, changed to the right variable
Sorry, the problem is solved. |
Addressing suggestions
Variable without whitespace
tpikonen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting back to this. The dialog layout and functionality look mostly OK (except for the date column width) and the functionality is fine.
some bugs in the previous version
tpikonen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I still found some things to tweak, but it's almost there.
more updates and change the Updated and Channel column
|
I'm not sure how to fix the horizontal scrollbar issue, but it should be okay to merge it as is. Everyone agreed on changing |
Rename of Channel to Podcast and change the pause icon
Ok, I upload a new version with the requested changes. |
|
I have enabled this extension in gPodder settings to test this new functionality out, but I don't know where these stats are shown or how to use this new feature. Can you help me on this one? Thx in advance. |
|
Open the |
|
I was blind, thanx! |
Show publishing statistics for subscriptions, original from Brand Huntsman <http://qzx.com/mail/ , add column for last feed update and last episode update dates.
Ticket with this requests
#978