mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-23 19:37:40 +00:00
Fix pdf cover
Fix massadding books Add feature inform of duplicate books
This commit is contained in:
@@ -780,7 +780,17 @@ def get_download_link(book_id, book_format):
|
||||
else:
|
||||
abort(404)
|
||||
|
||||
def check_exists_book(authr,title):
|
||||
db.session.connection().connection.connection.create_function("lower", 1, lcase)
|
||||
q = list()
|
||||
authorterms = re.split(r'\s*&\s*', authr)
|
||||
for authorterm in authorterms:
|
||||
q.append(db.Books.authors.any(func.lower(db.Authors.name).ilike("%" + authorterm + "%")))
|
||||
|
||||
return db.session.query(db.Books).filter(
|
||||
and_(db.Books.authors.any(and_(*q)),
|
||||
func.lower(db.Books.title).ilike("%" + title + "%")
|
||||
)).first()
|
||||
|
||||
############### Database Helper functions
|
||||
|
||||
|
Reference in New Issue
Block a user