Added config option for shelf sync behavior

This commit is contained in:
Ozzie Isaacs
2021-05-15 10:45:51 +02:00
parent b3648187ff
commit d95838309e
9 changed files with 67 additions and 26 deletions
+3 -3
View File
@@ -240,8 +240,8 @@ def edit_shelf(shelf_id):
# if shelf ID is set, we are editing a shelf
def create_edit_shelf(shelf, title, page, shelf_id=False):
sync_all_books = calibre_db.session.query(ub.Shelf).filter(ub.Shelf.user_id == current_user.id)\
.filter(ub.Shelf.kobo_sync).count()
sync_only_selected_shelves = current_user.kobo_only_shelves_sync
# calibre_db.session.query(ub.Shelf).filter(ub.Shelf.user_id == current_user.id).filter(ub.Shelf.kobo_sync).count()
if request.method == "POST":
to_save = request.form.to_dict()
shelf.is_public = 1 if to_save.get("is_public") else 0
@@ -277,7 +277,7 @@ def create_edit_shelf(shelf, title, page, shelf_id=False):
title=title,
page=page,
kobo_sync_enabled=config.config_kobo_sync,
sync_all_books=sync_all_books)
sync_only_selected_shelves=sync_only_selected_shelves)
def check_shelf_is_unique(shelf, to_save, shelf_id=False):