diff --git a/cps/db.py b/cps/db.py index 4b0a7ac7..9c5b5657 100644 --- a/cps/db.py +++ b/cps/db.py @@ -796,23 +796,24 @@ 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 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)) \ .group_by(text('books_languages_link.lang_code')).all() - for lang in languages: - 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: + for lang in languages: + 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) \ .filter(self.common_filters(return_all_languages=return_all_languages)) \ .group_by(text('books_languages_link.lang_code')).all() - for lang in languages: - lang.name = isoLanguages.get_language_name(get_locale(), lang.lang_code) + for lang in languages: + lang.name = isoLanguages.get_language_name(get_locale(), lang.lang_code) return sorted(languages, key=lambda x: x.name, reverse=reverse_order) diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 3c54e88b..d291d368 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2021-12-05 19:18:28

+

Start Time: 2021-12-22 20:24:40

-

Stop Time: 2021-12-05 22:58:48

+

Stop Time: 2021-12-23 00:00:41

-

Duration: 3h 0 min

+

Duration: 2h 57 min

@@ -705,11 +705,11 @@ - + TestEditAdditionalBooks 16 - 14 - 0 + 13 + 1 0 2 @@ -844,11 +844,31 @@ - +
TestEditAdditionalBooks - test_writeonly_path
- PASS + +
+ FAIL +
+ + + + @@ -881,11 +901,11 @@ - + TestEditBooks 35 - 34 - 0 + 32 + 2 0 1 @@ -904,11 +924,31 @@ - +
TestEditBooks - test_edit_author
- PASS + +
+ FAIL +
+ + + + @@ -1057,11 +1097,31 @@ - +
TestEditBooks - test_edit_title
- PASS + +
+ FAIL +
+ + + + @@ -1405,11 +1465,11 @@ - + TestEditBooksOnGdrive 20 - 20 - 0 + 18 + 2 0 0 @@ -1428,11 +1488,31 @@ - +
TestEditBooksOnGdrive - test_edit_author
- PASS + +
+ FAIL +
+ + + + @@ -1554,11 +1634,31 @@ - +
TestEditBooksOnGdrive - test_edit_title
- PASS + +
+ FAIL +
+ + + + @@ -1858,11 +1958,11 @@ - + TestKoboSync 11 - 2 - 9 + 11 + 0 0 0 @@ -1872,35 +1972,11 @@ - +
TestKoboSync - test_book_download
- -
- FAIL -
- - - - + PASS @@ -1914,134 +1990,38 @@ AssertionError: {'Benefits': {}} != {} - +
TestKoboSync - test_kobo_sync_selected_shelfs
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_kobo_upload_book
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_shelves_add_remove_books
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_sync_changed_book
- -
- FAIL -
- - - - + PASS @@ -2055,144 +2035,48 @@ AssertionError: {'Benefits': {}} != {} - +
TestKoboSync - test_sync_reading_state
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_sync_shelf
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_sync_unchanged
- -
- FAIL -
- - - - + PASS - +
TestKoboSync - test_sync_upload
- -
- FAIL -
- - - - + PASS - + TestKoboSyncBig 5 - 1 - 4 + 5 + 0 0 0 @@ -2211,134 +2095,38 @@ AssertionError: {'Benefits': {}} != {} - +
TestKoboSyncBig - test_kobo_sync_selected_shelfs
- -
- FAIL -
- - - - + PASS - +
TestKoboSyncBig - test_sync_changed_book
- -
- FAIL -
- - - - + PASS - +
TestKoboSyncBig - test_sync_reading_state
- -
- FAIL -
- - - - + PASS - +
TestKoboSyncBig - test_sync_shelf
- -
- FAIL -
- - - - + PASS @@ -4377,11 +4165,11 @@ AssertionError: 0 != 1 - + TestCalibreHelper 16 - 16 - 0 + 11 + 5 0 0 @@ -4454,29 +4242,95 @@ AssertionError: 0 != 1 - +
TestCalibreHelper - test_check_chinese_Characters
- PASS + +
+ FAIL +
+ + + + - +
TestCalibreHelper - test_check_deg_eur_replacement
- PASS + +
+ FAIL +
+ + + + - +
TestCalibreHelper - test_check_doubleS
- PASS + +
+ FAIL +
+ + + + @@ -4490,20 +4344,64 @@ AssertionError: 0 != 1 - +
TestCalibreHelper - test_check_high23
- PASS + +
+ FAIL +
+ + + + - +
TestCalibreHelper - test_check_umlauts
- PASS + +
+ FAIL +
+ + + + @@ -4538,8 +4436,8 @@ AssertionError: 0 != 1 Total 378 - 358 - 14 + 361 + 11 0 6   @@ -4581,7 +4479,7 @@ AssertionError: 0 != 1 Babel - 2.9.0 + 2.9.1 Basic @@ -4593,13 +4491,13 @@ AssertionError: 0 != 1 Flask - 1.1.2 + 2.0.2 Basic Flask-Babel - 1.0.0 + 2.0.0 Basic @@ -4627,12 +4525,6 @@ AssertionError: 0 != 1 Basic - - httplib2 - 0.14.0 - Basic - - iso-639 0.4.5 @@ -4641,25 +4533,13 @@ AssertionError: 0 != 1 Jinja2 - 2.11.2 + 3.0.3 Basic lxml - 4.6.3 - Basic - - - - natsort - 7.1.0 - Basic - - - - pyasn1 - 0.4.8 + 4.6.5 Basic @@ -4671,31 +4551,19 @@ AssertionError: 0 != 1 pytz - 2019.3 - Basic - - - - PyYAML - 5.3.1 + 2021.3 Basic requests - 2.22.0 - Basic - - - - six - 1.14.0 + 2.24.0 Basic SQLAlchemy - 1.4.27 + 1.4.28 Basic @@ -4707,7 +4575,7 @@ AssertionError: 0 != 1 Unidecode - 1.1.1 + 1.2.0 Basic @@ -4719,13 +4587,13 @@ AssertionError: 0 != 1 Werkzeug - 1.0.1 + 2.0.2 Basic google-api-python-client - 2.32.0 + 2.33.0 TestCliGdrivedb @@ -4749,13 +4617,13 @@ AssertionError: 0 != 1 PyYAML - 5.3.1 + 6.0 TestCliGdrivedb google-api-python-client - 2.32.0 + 2.33.0 TestEbookConvertCalibreGDrive @@ -4779,13 +4647,13 @@ AssertionError: 0 != 1 PyYAML - 5.3.1 + 6.0 TestEbookConvertCalibreGDrive google-api-python-client - 2.32.0 + 2.33.0 TestEbookConvertGDriveKepubify @@ -4809,7 +4677,7 @@ AssertionError: 0 != 1 PyYAML - 5.3.1 + 6.0 TestEbookConvertGDriveKepubify @@ -4827,7 +4695,7 @@ AssertionError: 0 != 1 google-api-python-client - 2.32.0 + 2.33.0 TestEditBooksOnGdrive @@ -4851,13 +4719,13 @@ AssertionError: 0 != 1 PyYAML - 5.3.1 + 6.0 TestEditBooksOnGdrive google-api-python-client - 2.32.0 + 2.33.0 TestSetupGdrive @@ -4881,7 +4749,7 @@ AssertionError: 0 != 1 PyYAML - 5.3.1 + 6.0 TestSetupGdrive @@ -4899,13 +4767,13 @@ AssertionError: 0 != 1 jsonschema - 4.2.1 + 4.3.2 TestKoboSync jsonschema - 4.2.1 + 4.3.2 TestKoboSyncBig @@ -4917,7 +4785,7 @@ AssertionError: 0 != 1 jsonschema - 4.2.1 + 4.3.2 TestLdapLogin @@ -4935,7 +4803,7 @@ AssertionError: 0 != 1 SQLAlchemy-Utils - 0.37.9 + 0.38.1 TestOAuthLogin @@ -4947,7 +4815,7 @@ AssertionError: 0 != 1