Hello, FriedBunny!

FriedBunny wrote:
> As a new user of gPodder, first off I'd like to thank everybody for
> their hard work -- this project is exactly what I was looking for.
> 
> I noticed that the 'channel' column doesn't sort (and that this was a
> TO-DO), so I decided to try my hand at a simple fix. It's just two
> lines and it won't automatically sort when gPodder starts up, but it's
> a start.

Thanks for your patch, but it won't work because internally, gPodder
uses the selected index in the list to select the internal channel
object. To get the desired effect, the channel list has to be sorted in
load_channels(), i.e. the GUI code receives a fully sorted list of
episodes already.

I've done this in the patch attached. This makes the channel list always
sorted. Please test the patch to see if it works. If it does, just get
back to me and I'll commit it to our repository :)

Thanks for your patch and your suggestion, though =) Because of it, I
got thinking about how to best implement this, and if you look at the
patch, it's a really simple one-liner :) Should have thougt about this
before.. hehe..

Thanks,
Thomas
Index: TODO
===================================================================
--- TODO	(revision 478)
+++ TODO	(working copy)
@@ -20,9 +20,6 @@
    continues to check the other feeds. I think a timeout of 10 seconds 
    is reasonable. 
 
- Is it possible to sort the Channel list by alphabetical order, or to
-   add this as a preference?
-
                (suggested by Paul Elliott <[EMAIL PROTECTED]>)
 
  * My element for the wishlist: have gPodder produce a sound when a 
Index: src/gpodder/libpodcasts.py
===================================================================
--- src/gpodder/libpodcasts.py	(revision 478)
+++ src/gpodder/libpodcasts.py	(working copy)
@@ -741,6 +741,7 @@
         count += 1
 
     podcastChannel.clear_cache(urls_to_keep)
+    result.sort(key=lambda x:x.title.lower())
     return result
 
 def save_channels( channels):
_______________________________________________
gpodder-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-devel

Reply via email to