mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-25 09:30:31 +00:00
Merge remote-tracking branch 'Goodread_fix/patch-test'
This commit is contained in:
commit
30d9991daf
@ -332,7 +332,12 @@ def update_dir_stucture(book_id, calibrepath):
|
||||
if titledir != new_titledir:
|
||||
try:
|
||||
new_title_path = os.path.join(os.path.dirname(path), new_titledir)
|
||||
os.renames(path, new_title_path)
|
||||
if not os.path.exists(new_title_path):
|
||||
os.renames(path, new_title_path)
|
||||
else:
|
||||
for dir_name, subdir_list, file_list in os.walk(path):
|
||||
for file in file_list:
|
||||
os.renames(os.path.join(dir_name, file), os.path.join(new_title_path + dir_name[len(path):], file))
|
||||
path = new_title_path
|
||||
localbook.path = localbook.path.split('/')[0] + '/' + new_titledir
|
||||
except OSError as ex:
|
||||
|
10
cps/web.py
10
cps/web.py
@ -1226,9 +1226,13 @@ def author(book_id, page):
|
||||
author_info = None
|
||||
other_books = []
|
||||
if goodreads_support and config.config_use_goodreads:
|
||||
gc = GoodreadsClient(config.config_goodreads_api_key, config.config_goodreads_api_secret)
|
||||
author_info = gc.find_author(author_name=name)
|
||||
other_books = get_unique_other_books(entries.all(), author_info.books)
|
||||
try:
|
||||
gc = GoodreadsClient(config.config_goodreads_api_key, config.config_goodreads_api_secret)
|
||||
author_info = gc.find_author(author_name=name)
|
||||
other_books = get_unique_other_books(entries.all(), author_info.books)
|
||||
except:
|
||||
# Skip goodreads, if site is down/inaccessible
|
||||
pass
|
||||
|
||||
return render_title_template('author.html', entries=entries, pagination=pagination,
|
||||
title=name, author=author_info, other_books=other_books)
|
||||
|
Loading…
Reference in New Issue
Block a user