websiteWebsite
bluemindo Bluemindo
Simple yet powerful audio player in Python/PyGTK, using Gstreamer.

Bug tracking

» Click here to report a bug on this project.

Bug report #530
Title: Artist list should not be case sensitive
Date added: 2009-02-16 21:53:43 Type: Bug report
Status: Resolved Priority: Normal
Affected version: trunk Milestone: n/a
Reported by: strider Assigned to: xbright
History:
  • 2009-02-16 21:53:43 - create by strider
  • 2009-02-17 20:44:30 - update by strider
    Added an answer
  • 2009-02-17 20:47:57 - update by strider
    Added an answer
  • 2009-02-21 13:11:20 - update by xbright
    Added an answer
  • 2009-02-21 13:11:40 - update by xbright
    Status changed to Resolved
    Version changed to trunk
    Assign to xbright
Feed subscription: RSS or Atom.
Attachements:
On the artist list the names starting with an upper case character appear first then the one starting with lower case.
The sorting method should be case insensitive
Re: Artist list should not be case sensitive - 2009-02-17 20:44:30
striderstrider
Send a mail to this userContact this user by JabberView the website of the userOpenForge API
Et voila ^^

The same operation has to be done in normal.py and basic.py

 
Index: full.py
===================================================================
--- full.py     (revision 90)
+++ full.py     (working copy)
@@ -126,6 +126,15 @@
 
     def insert_artists(self, pbar, treestore, force_scan):
         """This function is called at the start-up and add artists."""
+        def artist_sort(x, y):
+            """This function sorts songs."""
+            if x[0].lower() == y[0].lower():
+                return 0
+            elif x[0].lower() < y[0].lower():
+                return -1
+            else:
+                return 1
+        
         threads_enter()
 
         # Call database
@@ -141,7 +150,7 @@
 
         pbar.set_text(_('Loading artists…'))
         items = self.songs_tree.items()
-        items.sort()
+        items.sort(artist_sort)
         items_sort = [key for key, value in items]
 
         treestore.clear()
 
 
Re: Artist list should not be case sensitive - 2009-02-17 20:47:57
striderstrider
Send a mail to this userContact this user by JabberView the website of the userOpenForge API
Of course the comment should read : """This function sorts artists.""" =P
Re: Artist list should not be case sensitive - 2009-02-21 13:11:20
xbrightxbright
Send a mail to this userContact this user by JabberView the website of the userOpenForge API
Thanks for the patch, fixed in r93.
This bug is closed.