From 350ba190d4fa119543de6f53a02d33598c2dfcb1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 28 Oct 2021 21:22:50 +0530 Subject: [PATCH] pep8 --- src/calibre/db/categories.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/db/categories.py b/src/calibre/db/categories.py index deac2094cc..b3ec3e1a9f 100644 --- a/src/calibre/db/categories.py +++ b/src/calibre/db/categories.py @@ -127,6 +127,7 @@ def sort_key_for_name_and_first_letter(x): return (c if numeric_collation and c.isdigit() else '9999999999', collation_order(v2), sort_key(v1)) + category_sort_keys = {True:{}, False: {}} category_sort_keys[True]['popularity'] = category_sort_keys[False]['popularity'] = \ lambda x:(-getattr(x, 'count', 0), sort_key(x.sort or x.name))