<%inherit file="base.html"/> <%! import lazylibrarian from lazylibrarian.config2 import CONFIG %> <%def name="headerIncludes()">
%if perm&lazylibrarian.perm_status: %if author['Status'] == 'Paused': Paused %else: %if author['Status'] == 'Active': Active %else: %if author['Status'] == 'Wanted': Wanted %else: Ignored %endif %endif %endif %endif %if perm&lazylibrarian.perm_force: Refresh Author eBook Scan %if CONFIG.get_int('AUDIO_TAB') > 0: AudioBook Scan %endif %endif %if perm&lazylibrarian.perm_edit: %endif %if ignored == 'True': %if library == 'AudioBook': Show Active %else: Show Active %endif %else: %if library == 'AudioBook': Show Ignored %else: Show Ignored %endif %endif %if showseries >= 1: %if perm&lazylibrarian.perm_series: Series %endif %endif %if CONFIG['GR_FOLLOW']: %if author['GRfollow']: %if author['GRfollow'] != '0': Following %else: Not Following %endif %else: Not Following %endif %endif %if lazylibrarian.PRIMARY_AUTHORS == True: %else: %endif
%if len(types) > 1: %if perm&lazylibrarian.perm_audio: %endif %endif %if len(languages) > 1: %endif
%if CONFIG['USER_ACCOUNTS']: %if CONFIG['RSS_ENABLED']: %if CONFIG.get_int('EBOOK_TAB') > 0:   %endif %if CONFIG.get_int('AUDIO_TAB') > 0:   %endif %endif %endif
<%def name="body()">
<% # Every linked source, each with its own stored page link (see # INFOSOURCES author_link / link_author_source, set_primary_source, # get_all_author_details). No single "primary" is needed here any # more - that's still tracked (PrimarySource) for future metadata- # merge preference, but this page just lists what's linked. linkable_sources = [(name, src['author_key'], src['author_link']) for name, src in lazylibrarian.INFOSOURCES.items() if src.get('author_link')] linked_sources = [(name, author.get(link_col)) for name, id_col, link_col in linkable_sources if author.get(id_col)] %>

${author['AuthorName']} %if perm&lazylibrarian.perm_edit: Edit %endif

%if linked_sources or gb_search_link or amazon_search_link or author.get('AmazonAuthorURL'):

%for name, link in linked_sources: %if link: ${name}   %else: ${name}   %endif %endfor %if gb_search_link: GoogleBooks (search)   %endif %if author.get('AmazonAuthorURL'): Amazon   %elif amazon_search_link: Amazon (search)   %endif

%endif %if CONFIG['SHOW_REASON']: %if author['Reason']: <% reasonlist = author['Reason'].split() match reasonlist[0].lower().strip(":"): case 'webserver': # manual search and add of author reasonstring = "Manual search" case 'wishlist': # added via wishlist rss search reasonstring = "Wishlist search " + ' '.join(reasonlist[1:]) case 'process_alternate': # added via import of alt folder reasonstring = f"Import {' '.join(reasonlist[1:])} from alternate folder" case 'ol.find_book': reasonstring = "OpenLibrary search" case 'ol_get_author_books': reasonstring = "OpenLibrary search" case 'gr.find_book': reasonstring = "GoodReads search" case 'gr_get_author_books': reasonstring = "GoodReads search" case 'hc.find_book': reasonstring = "HardCover search" case 'hc_get_author_books': reasonstring = "HardCover search" case 'gb.find_book': reasonstring = "GoogleBooks search" case 'gb_get_author_books': reasonstring = "GoogleBooks search" case 'import_csv': reasonstring = "CSV import" case 'sync_calibre_list': reasonstring = "Calibre Sync" case 'api': #by name, id, and refresh reasonstring = "API" case 'add': reasonstring = f"Import author of {' '.join(reasonlist[3:])}" case 'contributor': reasonstring = ' '.join(reasonlist) case 'series': reasonstring = "Search for series " + ' '.join(reasonlist[1:]) case _: reasonstring = null %> %else: reasonstring = "Book added before reason set" %endif %if reasonstring:

Added by: ${reasonstring}

%endif %endif %if author['AuthorDeath']:

Born: ${author['AuthorBorn']}, Died: ${author['AuthorDeath']}

%else: %if author['AuthorBorn']:

Born: ${author['AuthorBorn']}

%endif %endif %if author['Status'] == 'Loading':

%endif

Totalbooks: ${author['TotalBooks']}

<% totalbooks = author['UnignoredBooks'] havebooks = author['HaveBooks'] if not havebooks: havebooks = 0 try: percent = (havebooks*100.0)/totalbooks if percent > 100: percent = 100 if percent <= 100: css = "bg-success" if percent <= 75: css = "bg-info" if percent <= 50: css = "bg-warning" if percent <= 25: css = "bg-danger" except (ZeroDivisionError, TypeError): percent = 0 totalbooks = '0' css = "bg-danger" %>
Progress:
${percent}% Complete
${havebooks} / ${totalbooks}
%if perm&lazylibrarian.perm_status or CONFIG['USER_ACCOUNTS']:
%if CONFIG['TOGGLES']: %endif
Cover Title Series Released Added Status

 

<%def name="javascriptIncludes()">