From 0bc15636f2c0195ed1238d5af1ed47dc6f95647b Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Tue, 1 Feb 2022 20:08:42 +0100 Subject: [PATCH] Bugfixes for renaming authors on gdrive --- cps/editbooks.py | 2 +- cps/helper.py | 5 +- test/Calibre-Web TestSummary_Linux.html | 925 +++++++++++++----------- 3 files changed, 516 insertions(+), 416 deletions(-) diff --git a/cps/editbooks.py b/cps/editbooks.py index 41df5a2e..21561766 100755 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -1066,7 +1066,7 @@ def upload(): book_id = db_book.id title = db_book.title - + # ToDo this currently doesn't work -> integrate in update_dir_structure_gdrive error = helper.update_dir_structure_file(book_id, config.config_calibre_dir, input_authors[0], diff --git a/cps/helper.py b/cps/helper.py index c9462ca7..26cca79c 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -464,8 +464,9 @@ def update_dir_structure_gdrive(book_id, first_author, renamed_author): gFile = gd.getFileFromEbooksFolder(None, old_author_dir) if gFile: gd.moveGdriveFolderRemote(gFile, new_author_rename_dir) - else: - error = _(u'File %(file)s not found on Google Drive', file=authordir) # file not found + # author is always co-author and has is never author, no folder is okay + #else: + # error = _(u'File %(file)s not found on Google Drive', file=authordir) # file not found else: new_authordir = get_valid_filename(book.authors[0].name, chars=96) diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index aa032162..742ae9fb 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2022-01-30 21:26:41

+

Start Time: 2022-01-31 21:25:49

-

Stop Time: 2022-01-31 01:29:29

+

Stop Time: 2022-02-01 01:40:44

-

Duration: 3h 21 min

+

Duration: 3h 28 min

@@ -1351,32 +1351,52 @@ - - TestEditBooksList - 18 - 18 - 0 - 0 + + TestEditAuthorsGdrive + 6 + 2 + 3 0 + 1 - Detail + Detail - + -
TestEditBooksList - test_bookslist_edit_author
+
TestEditAuthorsGdrive - test_change_capital_co_author
+ + +
+ FAIL +
+ + + - PASS -
TestEditBooksList - test_bookslist_edit_categories
+
TestEditAuthorsGdrive - test_change_capital_one_author_one_book
PASS @@ -1384,6 +1404,115 @@ + +
TestEditAuthorsGdrive - test_change_capital_one_author_two_books
+ + PASS + + + + + + +
TestEditAuthorsGdrive - test_change_capital_rename_co_author
+ + +
+ FAIL +
+ + + + + + + + + + +
TestEditAuthorsGdrive - test_change_capital_rename_two_co_authors
+ + +
+ FAIL +
+ + + + + + + + + + +
TestEditAuthorsGdrive - test_rename_capital_on_upload
+ + SKIP + + + + + + + TestEditBooksList + 18 + 18 + 0 + 0 + 0 + + Detail + + + + + + + +
TestEditBooksList - test_bookslist_edit_author
+ + PASS + + + + + + +
TestEditBooksList - test_bookslist_edit_categories
+ + PASS + + + + +
TestEditBooksList - test_bookslist_edit_comment
@@ -1392,7 +1521,7 @@ - +
TestEditBooksList - test_bookslist_edit_cust_category
@@ -1401,7 +1530,7 @@ - +
TestEditBooksList - test_bookslist_edit_cust_comment
@@ -1410,7 +1539,7 @@ - +
TestEditBooksList - test_bookslist_edit_cust_enum
@@ -1419,7 +1548,7 @@ - +
TestEditBooksList - test_bookslist_edit_cust_float
@@ -1428,7 +1557,7 @@ - +
TestEditBooksList - test_bookslist_edit_cust_int
@@ -1437,7 +1566,7 @@ - +
TestEditBooksList - test_bookslist_edit_cust_ratings
@@ -1446,7 +1575,7 @@ - +
TestEditBooksList - test_bookslist_edit_cust_text
@@ -1455,7 +1584,7 @@ - +
TestEditBooksList - test_bookslist_edit_languages
@@ -1464,7 +1593,7 @@ - +
TestEditBooksList - test_bookslist_edit_publisher
@@ -1473,7 +1602,7 @@ - +
TestEditBooksList - test_bookslist_edit_series
@@ -1482,7 +1611,7 @@ - +
TestEditBooksList - test_bookslist_edit_seriesindex
@@ -1491,7 +1620,7 @@ - +
TestEditBooksList - test_bookslist_edit_title
@@ -1500,7 +1629,7 @@ - +
TestEditBooksList - test_list_visibility
@@ -1509,7 +1638,7 @@ - +
TestEditBooksList - test_restricted_rights
@@ -1518,7 +1647,7 @@ - +
TestEditBooksList - test_search_books_list
@@ -1536,13 +1665,13 @@ 0 0 - Detail + Detail - +
TestLoadMetadata - test_load_metadata
@@ -1552,21 +1681,21 @@ - + TestEditBooksOnGdrive 20 - 19 - 1 + 20 + 0 0 0 - Detail + Detail - +
TestEditBooksOnGdrive - test_download_book
@@ -1575,7 +1704,7 @@ - +
TestEditBooksOnGdrive - test_edit_author
@@ -1584,7 +1713,7 @@ - +
TestEditBooksOnGdrive - test_edit_category
@@ -1593,7 +1722,7 @@ - +
TestEditBooksOnGdrive - test_edit_comments
@@ -1602,7 +1731,7 @@ - +
TestEditBooksOnGdrive - test_edit_custom_bool
@@ -1611,7 +1740,7 @@ - +
TestEditBooksOnGdrive - test_edit_custom_categories
@@ -1620,7 +1749,7 @@ - +
TestEditBooksOnGdrive - test_edit_custom_float
@@ -1629,7 +1758,7 @@ - +
TestEditBooksOnGdrive - test_edit_custom_int
@@ -1638,7 +1767,7 @@ - +
TestEditBooksOnGdrive - test_edit_custom_rating
@@ -1647,7 +1776,7 @@ - +
TestEditBooksOnGdrive - test_edit_custom_single_select
@@ -1656,7 +1785,7 @@ - +
TestEditBooksOnGdrive - test_edit_custom_text
@@ -1665,7 +1794,7 @@ - +
TestEditBooksOnGdrive - test_edit_language
@@ -1674,7 +1803,7 @@ - +
TestEditBooksOnGdrive - test_edit_publisher
@@ -1683,7 +1812,7 @@ - +
TestEditBooksOnGdrive - test_edit_rating
@@ -1692,7 +1821,7 @@ - +
TestEditBooksOnGdrive - test_edit_series
@@ -1701,7 +1830,7 @@ - +
TestEditBooksOnGdrive - test_edit_title
@@ -1710,7 +1839,7 @@ - +
TestEditBooksOnGdrive - test_upload_book_epub
@@ -1719,7 +1848,7 @@ - +
TestEditBooksOnGdrive - test_upload_book_lit
@@ -1728,7 +1857,7 @@ - +
TestEditBooksOnGdrive - test_upload_cover_hdd
@@ -1737,75 +1866,35 @@ - +
TestEditBooksOnGdrive - test_watch_metadata
- -
- FAIL -
- - - - + PASS - + TestLoadMetadataScholar 1 - 0 1 0 0 + 0 - Detail + Detail - +
TestLoadMetadataScholar - test_load_metadata
- -
- FAIL -
- - - - + PASS @@ -1819,13 +1908,13 @@ AssertionError: 30 != 35 0 0 - Detail + Detail - +
TestSTARTTLS - test_STARTTLS
@@ -1834,7 +1923,7 @@ AssertionError: 30 != 35 - +
TestSTARTTLS - test_STARTTLS_SSL_setup_error
@@ -1843,7 +1932,7 @@ AssertionError: 30 != 35 - +
TestSTARTTLS - test_STARTTLS_resend_password
@@ -1861,13 +1950,13 @@ AssertionError: 30 != 35 0 0 - Detail + Detail - +
TestSSL - test_SSL_None_setup_error
@@ -1876,7 +1965,7 @@ AssertionError: 30 != 35 - +
TestSSL - test_SSL_STARTTLS_setup_error
@@ -1885,7 +1974,7 @@ AssertionError: 30 != 35 - +
TestSSL - test_SSL_logging_email
@@ -1894,7 +1983,7 @@ AssertionError: 30 != 35 - +
TestSSL - test_SSL_non_admin_user
@@ -1903,7 +1992,7 @@ AssertionError: 30 != 35 - +
TestSSL - test_SSL_only
@@ -1912,7 +2001,7 @@ AssertionError: 30 != 35 - +
TestSSL - test_email_limit
@@ -1921,7 +2010,7 @@ AssertionError: 30 != 35 - +
TestSSL - test_filepicker_two_file
@@ -1939,13 +2028,13 @@ AssertionError: 30 != 35 0 0 - Detail + Detail - +
TestBookDatabase - test_invalid_book_path
@@ -1963,13 +2052,13 @@ AssertionError: 30 != 35 0 0 - Detail + Detail - +
TestErrorReadColumn - test_invalid_custom_column
@@ -1978,7 +2067,7 @@ AssertionError: 30 != 35 - +
TestErrorReadColumn - test_invalid_custom_read_column
@@ -1996,13 +2085,13 @@ AssertionError: 30 != 35 0 1 - Detail + Detail - +
TestFilePicker - test_filepicker_limited_file
@@ -2011,19 +2100,19 @@ AssertionError: 30 != 35 - +
TestFilePicker - test_filepicker_new_file
- SKIP + SKIP
-