mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix display of all notes results
This commit is contained in:
parent
efeb345edd
commit
25fdaa735b
@ -371,10 +371,10 @@ class Notes:
|
|||||||
if snippet_size is None:
|
if snippet_size is None:
|
||||||
snippet_size = 64
|
snippet_size = 64
|
||||||
char_size = snippet_size * 8
|
char_size = snippet_size * 8
|
||||||
query = 'SELECT {0}.id, {0}.colname, {0}.item, substr({0}.searchable_text, 9, {1}) FROM {0} '.format('notes', char_size)
|
query = 'SELECT {0}.id, {0}.colname, {0}.item, substr({0}.searchable_text, 0, {1}) FROM {0} '.format('notes', char_size)
|
||||||
if restrict_to_fields:
|
if restrict_to_fields:
|
||||||
query += ' WHERE notes_db.notes.colname IN ({})'.format(','.join(repeat('?', len(restrict_to_fields))))
|
query += ' WHERE notes_db.notes.colname IN ({})'.format(','.join(repeat('?', len(restrict_to_fields))))
|
||||||
query += ' ORDER BY ctime DESC'
|
query += ' ORDER BY mtime DESC'
|
||||||
if limit is not None:
|
if limit is not None:
|
||||||
query += f' LIMIT {limit}'
|
query += f' LIMIT {limit}'
|
||||||
for record in conn.execute(query, tuple(restrict_to_fields)):
|
for record in conn.execute(query, tuple(restrict_to_fields)):
|
||||||
|
@ -24,7 +24,7 @@ def current_db() -> Cache:
|
|||||||
|
|
||||||
class NotesResultsDelegate(ResultsDelegate):
|
class NotesResultsDelegate(ResultsDelegate):
|
||||||
|
|
||||||
add_ellipsis = False
|
add_ellipsis = True
|
||||||
emphasize_text = False
|
emphasize_text = False
|
||||||
|
|
||||||
def result_data(self, result):
|
def result_data(self, result):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user