From 7b50516064e0635a536a42f38b7319754364af91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=97=E4=B9=8B?= Date: Tue, 3 Jul 2018 12:12:00 +0800 Subject: [PATCH] sorted_library_items_by_name sorted library items by the name --- src/calibre/srv/opds.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/srv/opds.py b/src/calibre/srv/opds.py index a819b75dc1..65d501b75c 100644 --- a/src/calibre/srv/opds.py +++ b/src/calibre/srv/opds.py @@ -301,7 +301,8 @@ class TopLevel(Feed): # {{{ categories] for x in subcatalogs: self.root.append(x) - for library_id, library_name in request_context.library_map.iteritems(): + sorted_library_items_by_name = sorted(request_context.library_map.items(), key=lambda item:item[1]) + for library_id, library_name in sorted_library_items_by_name: id_ = 'calibre-library:' + library_id self.root.append(E.entry( TITLE(_('Library:') + ' ' + library_name),