mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix libraries being sorted alphabetically by full path rather than just library name
This commit is contained in:
parent
f90de5d9d7
commit
331190c369
@ -79,7 +79,7 @@ class LibraryUsageStats(object): # {{{
|
|||||||
if lpath in locs:
|
if lpath in locs:
|
||||||
locs.remove(lpath)
|
locs.remove(lpath)
|
||||||
limit = tweaks['many_libraries'] if limit is None else limit
|
limit = tweaks['many_libraries'] if limit is None else limit
|
||||||
key = sort_key if len(locs) > limit else lambda x:self.stats[x]
|
key = (lambda x:sort_key(os.path.basename(x))) if len(locs) > limit else self.stats.get
|
||||||
locs.sort(key=key, reverse=len(locs)<=limit)
|
locs.sort(key=key, reverse=len(locs)<=limit)
|
||||||
for loc in locs:
|
for loc in locs:
|
||||||
yield self.pretty(loc), loc
|
yield self.pretty(loc), loc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user