Bugfix advanced search for language

Update results from testrun
This commit is contained in:
Ozzie Isaacs 2021-12-23 19:14:21 +01:00
parent bdedec90dd
commit ec73558b03
2 changed files with 313 additions and 444 deletions

View File

@ -796,8 +796,8 @@ class CalibreDB():
def speaking_language(self, languages=None, return_all_languages=False, with_count=False, reverse_order=False):
from . import get_locale
if not languages:
if with_count:
if not languages:
languages = self.session.query(Languages, func.count('books_languages_link.book'))\
.join(books_languages_link).join(Books)\
.filter(self.common_filters(return_all_languages=return_all_languages)) \
@ -806,6 +806,7 @@ class CalibreDB():
lang[0].name = isoLanguages.get_language_name(get_locale(), lang[0].lang_code)
return sorted(languages, key=lambda x: x[0].name, reverse=reverse_order)
else:
if not languages:
languages = self.session.query(Languages) \
.join(books_languages_link) \
.join(Books) \

File diff suppressed because it is too large Load Diff