diff --git a/cps/editbooks.py b/cps/editbooks.py index eb72a628..63e8aa0c 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -848,7 +848,7 @@ def upload(): book_id = db_book.id title = db_book.title - error = helper.update_dir_stucture(book_id, + error = helper.update_dir_structure_file(book_id, config.config_calibre_dir, input_authors[0], meta.file_path, @@ -872,10 +872,7 @@ def upload(): # save data to database, reread data calibre_db.session.commit() - #calibre_db.setup_db(config, ub.app_DB_path) - # Reread book. It's important not to filter the result, as it could have language which hide it from - # current users view (tags are not stored/extracted from metadata and could also be limited) - #book = calibre_db.get_book(book_id) + if config.config_use_google_drive: gdriveutils.updateGdriveCalibreFromLocal() if error: diff --git a/cps/gdriveutils.py b/cps/gdriveutils.py index a996f879..489bc6f5 100644 --- a/cps/gdriveutils.py +++ b/cps/gdriveutils.py @@ -213,7 +213,7 @@ def listRootFolders(): def getEbooksFolder(drive): - return getFolderInFolder('root',config.config_google_drive_folder,drive) + return getFolderInFolder('root', config.config_google_drive_folder, drive) def getFolderInFolder(parentId, folderName, drive): @@ -243,7 +243,7 @@ def getEbooksFolderId(drive=None): gDriveId.path = '/' session.merge(gDriveId) session.commit() - return + return gDriveId.gdrive_id def getFile(pathId, fileName, drive): diff --git a/cps/helper.py b/cps/helper.py index 7f7bb4a3..5178a522 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -414,7 +414,7 @@ def update_dir_structure_file(book_id, calibrepath, first_author, orignal_filepa src=new_path, dest=new_name, error=str(ex)) return False -def update_dir_structure_gdrive(book_id, first_author, original_filepath): +def update_dir_structure_gdrive(book_id, first_author): error = False book = calibre_db.get_book(book_id) path = book.path @@ -518,7 +518,7 @@ def uniq(inpt): def update_dir_stucture(book_id, calibrepath, first_author=None, orignal_filepath=None, db_filename=None): if config.config_use_google_drive: - return update_dir_structure_gdrive(book_id, first_author, orignal_filepath, db_filename) + return update_dir_structure_gdrive(book_id, first_author) else: return update_dir_structure_file(book_id, calibrepath, first_author, orignal_filepath, db_filename) diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 773b2fe8..0bb41cd6 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2020-09-08 20:59:08

+

Start Time: 2020-09-12 12:12:43

-

Stop Time: 2020-09-08 22:21:49

+

Stop Time: 2020-09-12 13:55:09

-

Duration: 1h 10 min

+

Duration: 1h 25 min

@@ -982,15 +982,15 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - - TestEditBooksGdrive - 1 + + TestEditBooksOnGdrive + 19 + 18 1 0 0 - 0 - Detail + Detail @@ -998,12 +998,194 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye -
TestEditBooksGdrive - test_config_gdrive
+
TestEditBooksOnGdrive - test_download_book
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_author
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_category
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_comments
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_custom_bool
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_custom_categories
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_custom_float
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_custom_int
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_custom_rating
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_custom_single_select
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_custom_text
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_language
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_publisher
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_rating
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_series
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_edit_title
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_upload_book_epub
+ + PASS + + + + + + +
TestEditBooksOnGdrive - test_upload_book_lit
PASS + + + +
TestEditBooksOnGdrive - test_upload_cover_hdd
+ + +
+ FAIL +
+ + + + + + + @@ -1108,6 +1290,30 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye + + TestSetupGdrive + 1 + 1 + 0 + 0 + 0 + + Detail + + + + + + + +
TestSetupGdrive - test_config_gdrive
+ + PASS + + + + + TestGoodreads 3 @@ -1116,13 +1322,13 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye 0 0 - Detail + Detail - +
TestGoodreads - test_author_page
@@ -1131,7 +1337,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestGoodreads - test_author_page_invalid
@@ -1140,7 +1346,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestGoodreads - test_goodreads_about
@@ -1158,13 +1364,13 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye 0 0 - Detail + Detail - +
TestCalibreHelper - test_author_sort
@@ -1173,7 +1379,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_author_sort_comma
@@ -1182,7 +1388,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_author_sort_junior
@@ -1191,7 +1397,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_author_sort_oneword
@@ -1200,7 +1406,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_author_sort_roman
@@ -1209,7 +1415,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_Limit_Length
@@ -1218,7 +1424,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_char_replacement
@@ -1227,7 +1433,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_chinese_Characters
@@ -1236,7 +1442,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_deg_eur_replacement
@@ -1245,7 +1451,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_doubleS
@@ -1254,7 +1460,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_finish_Dot
@@ -1263,7 +1469,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_high23
@@ -1272,7 +1478,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_check_umlauts
@@ -1281,7 +1487,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_random_password
@@ -1290,7 +1496,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_split_authors
@@ -1299,7 +1505,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestCalibreHelper - test_whitespaces
@@ -1317,13 +1523,13 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye 0 0 - Detail + Detail - +
TestKoboSync - test_kobo_about
@@ -1332,7 +1538,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestKoboSync - test_shelves_add_remove_books
@@ -1341,7 +1547,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestKoboSync - test_sync_changed_book
@@ -1350,7 +1556,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestKoboSync - test_sync_invalid
@@ -1359,7 +1565,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestKoboSync - test_sync_reading_state
@@ -1368,7 +1574,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestKoboSync - test_sync_shelf
@@ -1377,7 +1583,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestKoboSync - test_sync_unchanged
@@ -1386,7 +1592,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestKoboSync - test_sync_upload
@@ -1404,13 +1610,13 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye 0 0 - Detail + Detail - +
TestLdapLogin - test_LDAP_SSL
@@ -1419,7 +1625,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_LDAP_STARTTLS
@@ -1428,7 +1634,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_LDAP_fallback_Login
@@ -1437,7 +1643,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_LDAP_import
@@ -1446,7 +1652,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_LDAP_login
@@ -1455,7 +1661,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_invalid_LDAP
@@ -1464,7 +1670,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_ldap_about
@@ -1473,7 +1679,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_ldap_authentication
@@ -1482,7 +1688,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_ldap_kobo_sync
@@ -1491,7 +1697,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLdapLogin - test_ldap_opds_download_book
@@ -1509,13 +1715,13 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye 0 1 - Detail + Detail - +
TestLogging - test_access_log_recover
@@ -1524,7 +1730,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLogging - test_debug_log
@@ -1533,7 +1739,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLogging - test_failed_login
@@ -1542,19 +1748,19 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
TestLogging - test_failed_register
- SKIP + SKIP
-