<%inherit file="base.html"/> <%! import lazylibrarian from lazylibrarian.config2 import CONFIG %> <%def name="headerIncludes()">
Books %if perm&lazylibrarian.perm_edit: Edit %endif %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 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 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="javascriptIncludes()"> <%def name="body()"> <% linkable_sources = [(name, src['author_key'], src['author_link']) for name, src in lazylibrarian.INFOSOURCES.items() if src.get('author_link')] linked_sources = [(name, id_col, author.get(id_col), author.get(link_col)) for name, id_col, link_col in linkable_sources if author.get(id_col)] reasonstring = None if author.get('Reason'): reasonlist = author['Reason'].split() match reasonlist[0].lower().strip(":"): case 'webserver': reasonstring = "Manual search" case 'wishlist': reasonstring = "Wishlist search " + ' '.join(reasonlist[1:]) case 'process_alternate': reasonstring = f"Import {' '.join(reasonlist[1:])} from alternate folder" case 'ol.find_book' | 'ol_get_author_books': reasonstring = "OpenLibrary search" case 'gr.find_book' | 'gr_get_author_books': reasonstring = "GoodReads search" case 'hc.find_book' | 'hc_get_author_books': reasonstring = "HardCover search" case 'gb.find_book' | 'gb_get_author_books': reasonstring = "GoogleBooks search" case 'import_csv': reasonstring = "CSV import" case 'sync_calibre_list': reasonstring = "Calibre Sync" case 'api': 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 = author['Reason'] %>

${author['AuthorName']}

%if author.get('AKA'): <% # Stored as a single comma-delimited string (see get_list() usage # throughout importer.py) - split for display as a real list. akas = [a.strip() for a in author['AKA'].split(',') if a.strip()] %>

Also known as: %for aka in akas: ${aka} %endfor

%endif
%if author.get('AuthorDeath'):

Born: ${author['AuthorBorn']}

Died: ${author['AuthorDeath']}

%if author_age is not None:

Age at death: ${author_age}

%endif %elif author.get('AuthorBorn'):

Born: ${author['AuthorBorn']}

%if author_age is not None:

Age: ${author_age}

%endif %endif

Status: ${author['Status']}

Books: ${author['HaveBooks'] or 0} / ${author['TotalBooks'] or 0} total (${author['UnignoredBooks'] or 0} not ignored) — ${author.get('HaveEBooks') or 0} eBook${'' if author.get('HaveEBooks') == 1 else 's'}, ${author.get('HaveAudioBooks') or 0} AudioBook${'' if author.get('HaveAudioBooks') == 1 else 's'}

%if ebook_status_counts:

eBook status: %for status_name, status_count in sorted(ebook_status_counts.items()): ${status_name}: ${status_count} %endfor

%endif %if audio_status_counts and CONFIG.get_int('AUDIO_TAB') > 0:

AudioBook status: %for status_name, status_count in sorted(audio_status_counts.items()): ${status_name}: ${status_count} %endfor

%endif %if reasonstring:

Added by: ${reasonstring}

%endif %if author.get('DateAdded'):

Added: ${author['DateAdded']}

%endif %if author.get('Updated'):

Last updated: ${author['Updated']}

%endif %if author.get('GRfollow') and author['GRfollow'] != '0':

GoodReads: Following

%endif %if author.get('Manual') == '1':

Locked: settings are manually locked and won't be overwritten by refresh

%endif

Sources

%for name, id_col, sourceid, link in linked_sources: <% count, overlap = source_book_counts.get(id_col, (0, 0)) %> %endfor %if gb_search_link: <% gb_count, gb_overlap = source_book_counts.get('gb_id', (0, 0)) %> %endif %if amazon_search_link or author.get('AmazonAuthorURL'): <% amzn_count, amzn_overlap = source_book_counts.get('ASIN', (0, 0)) %> %endif %if not linked_sources and not gb_search_link and not amazon_search_link and not author.get('AmazonAuthorURL'): %endif
SourceIDLinkBooksOverlap
${name} %if author.get('PrimarySource') == name: %endif ${sourceid} %if link: ${link} %else: not fetched yet %endif ${count} %if count: ${overlap} (${round(100 * overlap / count)}%) %else: 0 %endif
GoogleBooks no author ID (search by name) ${gb_search_link}${gb_count} %if gb_count: ${gb_overlap} (${round(100 * gb_overlap / gb_count)}%) %else: 0 %endif
Amazon %if author.get('AmazonAuthorURL'): %endif ${'manually linked' if author.get('AmazonAuthorURL') else 'no author ID (search by name)'} %if author.get('AmazonAuthorURL'): ${author['AmazonAuthorURL']} %else: ${amazon_search_link} %endif ${amzn_count} %if amzn_count: ${amzn_overlap} (${round(100 * amzn_overlap / amzn_count)}%) %else: 0 %endif
No sources linked yet
%if author.get('LastBook'):

Most recent book on record

%if author.get('LastBookImg'):
${author['LastBook']}
%endif
%if author.get('LastBookID'):

${author['LastBook']} %if author.get('LastLink'): %endif

%elif author.get('LastLink'):

${author['LastBook']}

%else:

${author['LastBook']}

%endif %if author.get('LastDate'):

Date: ${author['LastDate']}

%endif
%endif %if librarian_note:
Librarian Note: ${librarian_note}
%endif %if author.get('About'):

About

${author['About']}
%endif %if about_by_source:

About — by source

Each linked source's own text, shown as-is, one after another - not intelligently merged.

%for source_name, source_about in about_by_source:

${source_name}:

${source_about}
%endfor
%endif