1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-09 19:53:02 +00:00
-Refactoring gdrive and file handling
-Improved error handling for gdrive
-bugfix "gdrive stopping after a while"
- Renaming book title working
- Still Bugs in upload file to gdrive and renaming author
This commit is contained in:
OzzieIsaacs
2018-07-14 08:31:52 +02:00
parent 413b10c58e
commit a8040ad3fa
5 changed files with 244 additions and 173 deletions

View File

@@ -691,6 +691,20 @@ def get_mail_settings():
return data
# Save downloaded books per user in calibre-web's own database
def update_download(book_id, user_id):
check = session.query(Downloads).filter(Downloads.user_id == user_id).filter(Downloads.book_id ==
book_id).first()
if not check:
new_download = Downloads(user_id=user_id, book_id=book_id)
session.add(new_download)
session.commit()
# Delete non exisiting downloaded books in calibre-web's own database
def delete_download(book_id):
session.query(Downloads).filter(book_id == Downloads.book_id).delete()
session.commit()
# Generate user Guest (translated text), as anoymous user, no rights
def create_anonymous_user():