View Single Post
Old 03-05-2009, 10:33 AM   #8
WayneD
Enthusiast
WayneD began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2007
Device: Android phone + PRS-505
Thumbs up one more tweak for the startup

One thing I thought of was that at startup time, we need to do two sorts in order to ensure that the user gets a nice sort order for something like author. The best solution is probably be to remember two most recent sorts the user did and rerun them both when refreshing the book list. Another is to do an initial sort by path and then apply the remembered sort (since that at least gets a remembered author sort to sub-sort by title instead of coming up in whatever order the DB returned the entries).

Code:
--- src/calibre/library/database2.py    2009-03-04 17:46:47 +0000
+++ src/calibre/library/database2.py    2009-03-05 15:21:33 +0000
@@ -256,6 +256,7 @@
         for r in temp:
             self._data[r[0]] = r
         self._map = [i[0] for i in self._data if i is not None]
+        self.sort('path', ascending)
         if field is not None:
             self.sort(field, ascending)
         self._map_filtered = list(self._map)
WayneD is offline   Reply With Quote