janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
12.88k stars 1.38k forks source link

Author API possible work around and ?? and help needed #2854

Closed ShadowGrove closed 2 months ago

ShadowGrove commented 1 year ago

I posted this on a closed thread and didnt realize it was closed, until just now big DUH for me

I read all the posts about the Author API thing, which sounds like it was awesome before goodreads pulled the API key I completely Understand the original coders time constraints and not having space to take on re-writing the whole thing, thank you for doing it in the first place!! If i could code i would def be on it because its a highly requested feature from my forum peeps, and several on here

ok so here goes......

First i do not code, i struggle with the bbc on my forum lol, BUT i was able to take info on calibre templates and create a very basic work around for the author bio issue

Calibre has a spot for an author link inside the Manage Authors panel, in your Calibre it shows up as a little arrow icon that takes you to whatever link you put in the box, for the life of me i could not figure out how to turn that on in Calibre-Web, unless its to change the function of clicking on the author's name, but i need that to stay on the function that shows all books by that authors, so i ass-u-me'd that its not a working thing yet, or i have just further shown my tech stupidity

So first i had to create 3 custom columns because i do not know how to nest or even if it can be nested, I'm going to guess someone that actually does code can clean this up and make it a much better thing

CC1 - lookup name is bio1, column heading bio1, choose column built from other columns and use this template, (again please don't laugh i literally copied bits and pieces from posts on here, and played with them until they worked) Thank you to whoever wrote that code originally

program: 
    list_union(
        '', 
        re(
            list_re(author_links(':', ' & '),
                ' & ', 
                '^.*:(h.)', 
                '\1'), 
            '&', 
            ','),
        ',')

Im certain there is more there than is needed, but it works the way i want it to

CC2 - look up name bio2, heading bio2, built from other columns with this code <a href="{#bio1}">Author Bio</a>

CC3 - look up name bio3, heading Author's Page, built from other columns and this time check the box that says show as html in book details, then this code program: field(if field('#bio1') then '#bio2' else '' fi)

under preferences i unchecked the boxes to show the first 2 cc's in the book details, and the 3rd cc becomes a working link in the book details to the authors bio without having to manually paste it in to every cc for the author, this you just put the link in the spot in manage authors and it shows for each book

QUESTION???? can something similar be written for Pen Names? and here is kinda where my non coding brain went

cc1 - comma seperated list of pen names cc2 - use a function to search calibre for the authors , and if they are found then add whatever code is needed in a prefix/suffix thing for a search like author= or whatever it is that calibre uses to search for just that author cc3 - the html column that makes the code written above clickable like the author name and series is

If anyone is following my train wreck of a thought, any help would be much appreciated, even if its to just point me in a direction

OzzieIsaacs commented 1 year ago

From my experience with the issues here, it will be hard for you to find somebody answering your questions.

From my side, I didn't get what you are trying to do, and I didn't get the code snippets, so I can't help you

ShadowGrove commented 1 year ago

oh sorrry!!

so the link that is available for authors under the manage authors tab in calibre shows up as an arrow icon in the main calibre program but does not transfer over to calibre-web, so i created a custom column for it which does show up to make the link useable in Calibre-Web i was not sure if i missed something in not seeing it in calibre-web

then my other question was getting help for creating a code for a custom column that could work in a similar way for pen names

i added some screen shots, i'm horrible at explaining things

Screenshot 2023-08-04 055716 Screenshot 2023-08-04 060019 Screenshot 2023-08-04 060055 Screenshot 2023-08-04 060437