mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
bfb434fb30
commit
655d67a94d
@ -674,7 +674,7 @@ class Cache(object):
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
class SortKey(object):
|
class SortKey(object): # {{{
|
||||||
|
|
||||||
def __init__(self, fields, sort_keys, book_id):
|
def __init__(self, fields, sort_keys, book_id):
|
||||||
self.orders = tuple(1 if f[1] else -1 for f in fields)
|
self.orders = tuple(1 if f[1] else -1 for f in fields)
|
||||||
@ -686,19 +686,5 @@ class SortKey(object):
|
|||||||
if ans != 0:
|
if ans != 0:
|
||||||
return ans * order
|
return ans * order
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
# Testing {{{
|
|
||||||
|
|
||||||
def test(library_path):
|
|
||||||
from calibre.db.backend import DB
|
|
||||||
backend = DB(library_path)
|
|
||||||
cache = Cache(backend)
|
|
||||||
cache.init()
|
|
||||||
print ('All book ids:', cache.all_book_ids())
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
from calibre.utils.config import prefs
|
|
||||||
test(prefs['library_path'])
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user