|
|
@ -50,9 +50,10 @@ from . import constants, logger, isoLanguages, services
|
|
|
|
from . import babel, db, ub, config, get_locale, app
|
|
|
|
from . import babel, db, ub, config, get_locale, app
|
|
|
|
from . import calibre_db
|
|
|
|
from . import calibre_db
|
|
|
|
from .gdriveutils import getFileFromEbooksFolder, do_gdrive_download
|
|
|
|
from .gdriveutils import getFileFromEbooksFolder, do_gdrive_download
|
|
|
|
from .helper import check_valid_domain, render_task_status, \
|
|
|
|
from .helper import check_valid_domain, render_task_status, get_cc_columns, get_book_cover, get_cached_book_cover, \
|
|
|
|
get_cc_columns, get_book_cover, get_download_link, send_mail, generate_random_password, \
|
|
|
|
get_cached_book_cover_thumbnail, get_thumbnails_for_books, get_thumbnails_for_book_series, get_download_link, \
|
|
|
|
send_registration_mail, check_send_to_kindle, check_read_formats, tags_filters, reset_password
|
|
|
|
send_mail, generate_random_password, send_registration_mail, check_send_to_kindle, check_read_formats, \
|
|
|
|
|
|
|
|
tags_filters, reset_password
|
|
|
|
from .pagination import Pagination
|
|
|
|
from .pagination import Pagination
|
|
|
|
from .redirect import redirect_back
|
|
|
|
from .redirect import redirect_back
|
|
|
|
from .usermanagement import login_required_if_no_ano
|
|
|
|
from .usermanagement import login_required_if_no_ano
|
|
|
@ -411,8 +412,9 @@ def render_books_list(data, sort, book_id, page):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
website = data or "newest"
|
|
|
|
website = data or "newest"
|
|
|
|
entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, True, order)
|
|
|
|
entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, True, order)
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
title=_(u"Books"), page=website)
|
|
|
|
title=_(u"Books"), page=website, thumbnails=thumbnails)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def render_rated_books(page, book_id, order):
|
|
|
|
def render_rated_books(page, book_id, order):
|
|
|
@ -457,8 +459,9 @@ def render_hot_books(page):
|
|
|
|
ub.delete_download(book.Downloads.book_id)
|
|
|
|
ub.delete_download(book.Downloads.book_id)
|
|
|
|
numBooks = entries.__len__()
|
|
|
|
numBooks = entries.__len__()
|
|
|
|
pagination = Pagination(page, config.config_books_per_page, numBooks)
|
|
|
|
pagination = Pagination(page, config.config_books_per_page, numBooks)
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
title=_(u"Hot Books (Most Downloaded)"), page="hot")
|
|
|
|
title=_(u"Hot Books (Most Downloaded)"), page="hot", thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -482,12 +485,14 @@ def render_downloaded_books(page, order):
|
|
|
|
.filter(db.Books.id == book.id).first():
|
|
|
|
.filter(db.Books.id == book.id).first():
|
|
|
|
ub.delete_download(book.id)
|
|
|
|
ub.delete_download(book.id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html',
|
|
|
|
return render_title_template('index.html',
|
|
|
|
random=random,
|
|
|
|
random=random,
|
|
|
|
entries=entries,
|
|
|
|
entries=entries,
|
|
|
|
pagination=pagination,
|
|
|
|
pagination=pagination,
|
|
|
|
title=_(u"Downloaded books by %(user)s",user=current_user.nickname),
|
|
|
|
title=_(u"Downloaded books by %(user)s",user=current_user.nickname),
|
|
|
|
page="download")
|
|
|
|
page="download",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -498,6 +503,7 @@ def render_author_books(page, author_id, order):
|
|
|
|
db.Books.authors.any(db.Authors.id == author_id),
|
|
|
|
db.Books.authors.any(db.Authors.id == author_id),
|
|
|
|
[order[0], db.Series.name, db.Books.series_index],
|
|
|
|
[order[0], db.Series.name, db.Books.series_index],
|
|
|
|
db.books_series_link,
|
|
|
|
db.books_series_link,
|
|
|
|
|
|
|
|
db.Books.id==db.books_series_link.c.book,
|
|
|
|
db.Series)
|
|
|
|
db.Series)
|
|
|
|
if entries is None or not len(entries):
|
|
|
|
if entries is None or not len(entries):
|
|
|
|
flash(_(u"Oops! Selected book title is unavailable. File does not exist or is not accessible"),
|
|
|
|
flash(_(u"Oops! Selected book title is unavailable. File does not exist or is not accessible"),
|
|
|
@ -513,9 +519,10 @@ def render_author_books(page, author_id, order):
|
|
|
|
author_info = services.goodreads_support.get_author_info(author_name)
|
|
|
|
author_info = services.goodreads_support.get_author_info(author_name)
|
|
|
|
other_books = services.goodreads_support.get_other_books(author_info, entries)
|
|
|
|
other_books = services.goodreads_support.get_other_books(author_info, entries)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries)
|
|
|
|
return render_title_template('author.html', entries=entries, pagination=pagination, id=author_id,
|
|
|
|
return render_title_template('author.html', entries=entries, pagination=pagination, id=author_id,
|
|
|
|
title=_(u"Author: %(name)s", name=author_name), author=author_info,
|
|
|
|
title=_(u"Author: %(name)s", name=author_name), author=author_info,
|
|
|
|
other_books=other_books, page="author")
|
|
|
|
other_books=other_books, page="author", thumbnails=thumbnails)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def render_publisher_books(page, book_id, order):
|
|
|
|
def render_publisher_books(page, book_id, order):
|
|
|
@ -526,9 +533,12 @@ def render_publisher_books(page, book_id, order):
|
|
|
|
db.Books.publishers.any(db.Publishers.id == book_id),
|
|
|
|
db.Books.publishers.any(db.Publishers.id == book_id),
|
|
|
|
[db.Series.name, order[0], db.Books.series_index],
|
|
|
|
[db.Series.name, order[0], db.Books.series_index],
|
|
|
|
db.books_series_link,
|
|
|
|
db.books_series_link,
|
|
|
|
|
|
|
|
db.Books.id == db.books_series_link.c.book,
|
|
|
|
db.Series)
|
|
|
|
db.Series)
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=book_id,
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=book_id,
|
|
|
|
title=_(u"Publisher: %(name)s", name=publisher.name), page="publisher")
|
|
|
|
title=_(u"Publisher: %(name)s", name=publisher.name), page="publisher",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -540,8 +550,10 @@ def render_series_books(page, book_id, order):
|
|
|
|
db.Books,
|
|
|
|
db.Books,
|
|
|
|
db.Books.series.any(db.Series.id == book_id),
|
|
|
|
db.Books.series.any(db.Series.id == book_id),
|
|
|
|
[order[0]])
|
|
|
|
[order[0]])
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id,
|
|
|
|
return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id,
|
|
|
|
title=_(u"Series: %(serie)s", serie=name.name), page="series")
|
|
|
|
title=_(u"Series: %(serie)s", serie=name.name), page="series",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -553,8 +565,10 @@ def render_ratings_books(page, book_id, order):
|
|
|
|
db.Books.ratings.any(db.Ratings.id == book_id),
|
|
|
|
db.Books.ratings.any(db.Ratings.id == book_id),
|
|
|
|
[order[0]])
|
|
|
|
[order[0]])
|
|
|
|
if name and name.rating <= 10:
|
|
|
|
if name and name.rating <= 10:
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id,
|
|
|
|
return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id,
|
|
|
|
title=_(u"Rating: %(rating)s stars", rating=int(name.rating / 2)), page="ratings")
|
|
|
|
title=_(u"Rating: %(rating)s stars", rating=int(name.rating / 2)), page="ratings",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -566,8 +580,10 @@ def render_formats_books(page, book_id, order):
|
|
|
|
db.Books,
|
|
|
|
db.Books,
|
|
|
|
db.Books.data.any(db.Data.format == book_id.upper()),
|
|
|
|
db.Books.data.any(db.Data.format == book_id.upper()),
|
|
|
|
[order[0]])
|
|
|
|
[order[0]])
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id,
|
|
|
|
return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id,
|
|
|
|
title=_(u"File format: %(format)s", format=name.format), page="formats")
|
|
|
|
title=_(u"File format: %(format)s", format=name.format), page="formats",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -579,9 +595,13 @@ def render_category_books(page, book_id, order):
|
|
|
|
db.Books,
|
|
|
|
db.Books,
|
|
|
|
db.Books.tags.any(db.Tags.id == book_id),
|
|
|
|
db.Books.tags.any(db.Tags.id == book_id),
|
|
|
|
[order[0], db.Series.name, db.Books.series_index],
|
|
|
|
[order[0], db.Series.name, db.Books.series_index],
|
|
|
|
db.books_series_link, db.Series)
|
|
|
|
db.books_series_link,
|
|
|
|
|
|
|
|
db.Books.id == db.books_series_link.c.book,
|
|
|
|
|
|
|
|
db.Series)
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=book_id,
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=book_id,
|
|
|
|
title=_(u"Category: %(name)s", name=name.name), page="category")
|
|
|
|
title=_(u"Category: %(name)s", name=name.name), page="category",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -599,8 +619,9 @@ def render_language_books(page, name, order):
|
|
|
|
db.Books,
|
|
|
|
db.Books,
|
|
|
|
db.Books.languages.any(db.Languages.lang_code == name),
|
|
|
|
db.Books.languages.any(db.Languages.lang_code == name),
|
|
|
|
[order[0]])
|
|
|
|
[order[0]])
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=name,
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=name,
|
|
|
|
title=_(u"Language: %(name)s", name=lang_name), page="language")
|
|
|
|
title=_(u"Language: %(name)s", name=lang_name), page="language", thumbnails=thumbnails)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def render_read_books(page, are_read, as_xml=False, order=None):
|
|
|
|
def render_read_books(page, are_read, as_xml=False, order=None):
|
|
|
@ -644,8 +665,10 @@ def render_read_books(page, are_read, as_xml=False, order=None):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
name = _(u'Unread Books') + ' (' + str(pagination.total_count) + ')'
|
|
|
|
name = _(u'Unread Books') + ' (' + str(pagination.total_count) + ')'
|
|
|
|
pagename = "unread"
|
|
|
|
pagename = "unread"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
title=name, page=pagename)
|
|
|
|
title=name, page=pagename, thumbnails=thumbnails)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def render_archived_books(page, order):
|
|
|
|
def render_archived_books(page, order):
|
|
|
@ -668,8 +691,9 @@ def render_archived_books(page, order):
|
|
|
|
|
|
|
|
|
|
|
|
name = _(u'Archived Books') + ' (' + str(len(archived_book_ids)) + ')'
|
|
|
|
name = _(u'Archived Books') + ' (' + str(len(archived_book_ids)) + ')'
|
|
|
|
pagename = "archived"
|
|
|
|
pagename = "archived"
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries + random)
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
|
|
|
|
title=name, page=pagename)
|
|
|
|
title=name, page=pagename, thumbnails=thumbnails)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def render_prepare_search_form(cc):
|
|
|
|
def render_prepare_search_form(cc):
|
|
|
@ -702,6 +726,7 @@ def render_prepare_search_form(cc):
|
|
|
|
|
|
|
|
|
|
|
|
def render_search_results(term, offset=None, order=None, limit=None):
|
|
|
|
def render_search_results(term, offset=None, order=None, limit=None):
|
|
|
|
entries, result_count, pagination = calibre_db.get_search_results(term, offset, order, limit)
|
|
|
|
entries, result_count, pagination = calibre_db.get_search_results(term, offset, order, limit)
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries)
|
|
|
|
return render_title_template('search.html',
|
|
|
|
return render_title_template('search.html',
|
|
|
|
searchterm=term,
|
|
|
|
searchterm=term,
|
|
|
|
pagination=pagination,
|
|
|
|
pagination=pagination,
|
|
|
@ -710,7 +735,8 @@ def render_search_results(term, offset=None, order=None, limit=None):
|
|
|
|
entries=entries,
|
|
|
|
entries=entries,
|
|
|
|
result_count=result_count,
|
|
|
|
result_count=result_count,
|
|
|
|
title=_(u"Search"),
|
|
|
|
title=_(u"Search"),
|
|
|
|
page="search")
|
|
|
|
page="search",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ################################### View Books list ##################################################################
|
|
|
|
# ################################### View Books list ##################################################################
|
|
|
@ -740,6 +766,7 @@ def books_table():
|
|
|
|
return render_title_template('book_table.html', title=_(u"Books List"), page="book_table",
|
|
|
|
return render_title_template('book_table.html', title=_(u"Books List"), page="book_table",
|
|
|
|
visiblility=visibility)
|
|
|
|
visiblility=visibility)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/ajax/listbooks")
|
|
|
|
@web.route("/ajax/listbooks")
|
|
|
|
@login_required
|
|
|
|
@login_required
|
|
|
|
def list_books():
|
|
|
|
def list_books():
|
|
|
@ -772,6 +799,7 @@ def list_books():
|
|
|
|
response.headers["Content-Type"] = "application/json; charset=utf-8"
|
|
|
|
response.headers["Content-Type"] = "application/json; charset=utf-8"
|
|
|
|
return response
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/ajax/table_settings", methods=['POST'])
|
|
|
|
@web.route("/ajax/table_settings", methods=['POST'])
|
|
|
|
@login_required
|
|
|
|
@login_required
|
|
|
|
def update_table_settings():
|
|
|
|
def update_table_settings():
|
|
|
@ -826,6 +854,7 @@ def publisher_list():
|
|
|
|
charlist = calibre_db.session.query(func.upper(func.substr(db.Publishers.name, 1, 1)).label('char')) \
|
|
|
|
charlist = calibre_db.session.query(func.upper(func.substr(db.Publishers.name, 1, 1)).label('char')) \
|
|
|
|
.join(db.books_publishers_link).join(db.Books).filter(calibre_db.common_filters()) \
|
|
|
|
.join(db.books_publishers_link).join(db.Books).filter(calibre_db.common_filters()) \
|
|
|
|
.group_by(func.upper(func.substr(db.Publishers.name, 1, 1))).all()
|
|
|
|
.group_by(func.upper(func.substr(db.Publishers.name, 1, 1))).all()
|
|
|
|
|
|
|
|
|
|
|
|
return render_title_template('list.html', entries=entries, folder='web.books_list', charlist=charlist,
|
|
|
|
return render_title_template('list.html', entries=entries, folder='web.books_list', charlist=charlist,
|
|
|
|
title=_(u"Publishers"), page="publisherlist", data="publisher")
|
|
|
|
title=_(u"Publishers"), page="publisherlist", data="publisher")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -857,8 +886,10 @@ def series_list():
|
|
|
|
.join(db.books_series_link).join(db.Books).filter(calibre_db.common_filters()) \
|
|
|
|
.join(db.books_series_link).join(db.Books).filter(calibre_db.common_filters()) \
|
|
|
|
.group_by(func.upper(func.substr(db.Series.sort, 1, 1))).all()
|
|
|
|
.group_by(func.upper(func.substr(db.Series.sort, 1, 1))).all()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_book_series(entries)
|
|
|
|
return render_title_template('grid.html', entries=entries, folder='web.books_list', charlist=charlist,
|
|
|
|
return render_title_template('grid.html', entries=entries, folder='web.books_list', charlist=charlist,
|
|
|
|
title=_(u"Series"), page="serieslist", data="series", bodyClass="grid-view")
|
|
|
|
title=_(u"Series"), page="serieslist", data="series", bodyClass="grid-view",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
abort(404)
|
|
|
|
abort(404)
|
|
|
|
|
|
|
|
|
|
|
@ -1235,13 +1266,16 @@ def render_adv_search_results(term, offset=None, order=None, limit=None):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
offset = 0
|
|
|
|
offset = 0
|
|
|
|
limit_all = result_count
|
|
|
|
limit_all = result_count
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books(entries)
|
|
|
|
return render_title_template('search.html',
|
|
|
|
return render_title_template('search.html',
|
|
|
|
adv_searchterm=searchterm,
|
|
|
|
adv_searchterm=searchterm,
|
|
|
|
pagination=pagination,
|
|
|
|
pagination=pagination,
|
|
|
|
entries=q[offset:limit_all],
|
|
|
|
entries=q[offset:limit_all],
|
|
|
|
result_count=result_count,
|
|
|
|
result_count=result_count,
|
|
|
|
title=_(u"Advanced Search"), page="advsearch")
|
|
|
|
title=_(u"Advanced Search"),
|
|
|
|
|
|
|
|
page="advsearch",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/advsearch", methods=['GET'])
|
|
|
|
@web.route("/advsearch", methods=['GET'])
|
|
|
@ -1260,10 +1294,24 @@ def advanced_search_form():
|
|
|
|
def get_cover(book_id):
|
|
|
|
def get_cover(book_id):
|
|
|
|
return get_book_cover(book_id)
|
|
|
|
return get_book_cover(book_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/cached-cover/<string:cache_id>")
|
|
|
|
|
|
|
|
@login_required_if_no_ano
|
|
|
|
|
|
|
|
def get_cached_cover(cache_id):
|
|
|
|
|
|
|
|
return get_cached_book_cover(cache_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/cached-cover-thumbnail/<string:cache_id>")
|
|
|
|
|
|
|
|
@login_required_if_no_ano
|
|
|
|
|
|
|
|
def get_cached_cover_thumbnail(cache_id):
|
|
|
|
|
|
|
|
return get_cached_book_cover_thumbnail(cache_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/robots.txt")
|
|
|
|
@web.route("/robots.txt")
|
|
|
|
def get_robots():
|
|
|
|
def get_robots():
|
|
|
|
return send_from_directory(constants.STATIC_DIR, "robots.txt")
|
|
|
|
return send_from_directory(constants.STATIC_DIR, "robots.txt")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/show/<int:book_id>/<book_format>", defaults={'anyname': 'None'})
|
|
|
|
@web.route("/show/<int:book_id>/<book_format>", defaults={'anyname': 'None'})
|
|
|
|
@web.route("/show/<int:book_id>/<book_format>/<anyname>")
|
|
|
|
@web.route("/show/<int:book_id>/<book_format>/<anyname>")
|
|
|
|
@login_required_if_no_ano
|
|
|
|
@login_required_if_no_ano
|
|
|
@ -1293,7 +1341,6 @@ def serve_book(book_id, book_format, anyname):
|
|
|
|
return send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format)
|
|
|
|
return send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/download/<int:book_id>/<book_format>", defaults={'anyname': 'None'})
|
|
|
|
@web.route("/download/<int:book_id>/<book_format>", defaults={'anyname': 'None'})
|
|
|
|
@web.route("/download/<int:book_id>/<book_format>/<anyname>")
|
|
|
|
@web.route("/download/<int:book_id>/<book_format>/<anyname>")
|
|
|
|
@login_required_if_no_ano
|
|
|
|
@login_required_if_no_ano
|
|
|
@ -1481,9 +1528,6 @@ def logout():
|
|
|
|
return redirect(url_for('web.login'))
|
|
|
|
return redirect(url_for('web.login'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ################################### Users own configuration #########################################################
|
|
|
|
# ################################### Users own configuration #########################################################
|
|
|
|
def change_profile_email(to_save, kobo_support, local_oauth_check, oauth_status):
|
|
|
|
def change_profile_email(to_save, kobo_support, local_oauth_check, oauth_status):
|
|
|
|
if "email" in to_save and to_save["email"] != current_user.email:
|
|
|
|
if "email" in to_save and to_save["email"] != current_user.email:
|
|
|
@ -1683,6 +1727,7 @@ def show_book(book_id):
|
|
|
|
if media_format.format.lower() in constants.EXTENSIONS_AUDIO:
|
|
|
|
if media_format.format.lower() in constants.EXTENSIONS_AUDIO:
|
|
|
|
audioentries.append(media_format.format.lower())
|
|
|
|
audioentries.append(media_format.format.lower())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thumbnails = get_thumbnails_for_books([entries])
|
|
|
|
return render_title_template('detail.html',
|
|
|
|
return render_title_template('detail.html',
|
|
|
|
entry=entries,
|
|
|
|
entry=entries,
|
|
|
|
audioentries=audioentries,
|
|
|
|
audioentries=audioentries,
|
|
|
@ -1694,7 +1739,8 @@ def show_book(book_id):
|
|
|
|
is_archived=is_archived,
|
|
|
|
is_archived=is_archived,
|
|
|
|
kindle_list=kindle_list,
|
|
|
|
kindle_list=kindle_list,
|
|
|
|
reader_list=reader_list,
|
|
|
|
reader_list=reader_list,
|
|
|
|
page="book")
|
|
|
|
page="book",
|
|
|
|
|
|
|
|
thumbnails=thumbnails)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
log.debug(u"Error opening eBook. File does not exist or file is not accessible")
|
|
|
|
log.debug(u"Error opening eBook. File does not exist or file is not accessible")
|
|
|
|
flash(_(u"Error opening eBook. File does not exist or file is not accessible"), category="error")
|
|
|
|
flash(_(u"Error opening eBook. File does not exist or file is not accessible"), category="error")
|
|
|
|