mirror of
https://github.com/janeczku/calibre-web
synced 2025-02-23 14:30:05 +00:00
Fix change_archived so state=none is a toggle. Fixes /togglearchived endpoint
This commit is contained in:
parent
2ae80d3007
commit
2afce66486
@ -54,7 +54,7 @@ def remove_synced_book(book_id, all=False, session=None):
|
||||
def change_archived_books(book_id, state=None, message=None):
|
||||
archived_book = ub.session.query(ub.ArchivedBook).filter(and_(ub.ArchivedBook.user_id == int(current_user.id),
|
||||
ub.ArchivedBook.book_id == book_id)).first()
|
||||
if not archived_book and state == True:
|
||||
if not archived_book and (state == True or state == None):
|
||||
archived_book = ub.ArchivedBook(user_id=current_user.id, book_id=book_id)
|
||||
|
||||
archived_book.is_archived = state if state != None else not archived_book.is_archived
|
||||
|
Loading…
x
Reference in New Issue
Block a user