Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 01-15-2021, 01:31 PM   #1486
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by BetterRed View Post
You can put any type of URI in the Link field in Manage Authors, not just web page URL's. It could be link to a file, a web page, a note in a notebook app like Evernote or OneNote, or even a 'book' in another or the same calibre library using the recently implemented calibre:// URL scheme

I just converted from using Evernote notes to using the latter. I created an Authors library with various custom columns, including some long text columns. In my Books library I have 'show-book' links to the author's 'book' in the Authors library and in the Authors library I have 'search' links to the authors 'books' in my Books library.
How do you identify the author book? I'm looking at the documentation and "Show book" requires a book_id, not a parameter? How do you get that id? Manually?
Terisa de morgan is offline   Reply With Quote
Old 01-15-2021, 04:16 PM   #1487
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Terisa de morgan View Post
How do you identify the author book? I'm looking at the documentation and "Show book" requires a book_id, not a parameter? How do you get that id? Manually?
I use the Copy Link tools in the Book Details panel to get the link (in hex)… Link to show book in calibre, or Link to show books matching <Author Name> in calibre. Then I switch to the Books or Authors library (this is where the Switch to previous library shortcut comes into play) and paste the link just copied into the Manage <Author Name> Link field.

If you add a lot of 'new' authors, then you might want to consider automating the above via a plugin, or an Action Chain what's-it. I don't add new authors that often, so I have no need for automation.

My 'biggest' task wasn't the inter-library links, it was 'moving' the data out of the MHT files I exported from Evernote into the columns of 1,440 'books' in my Authors library. I used the MHT files to create the 'books' in the Authors library.

BR
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2021-01-16 072451.jpg
Views:	184
Size:	48.7 KB
ID:	184754   Click image for larger version

Name:	Screenshot 2021-01-16 072559.jpg
Views:	216
Size:	49.4 KB
ID:	184755  
BetterRed is online now   Reply With Quote
Advert
Old 01-16-2021, 04:02 AM   #1488
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thank you, I thought that was the way but I was not sure if there was an automated way. As I have a whole library with authors, that is not polished, I think I'll keep it for a future development... or I'll think for the future authors and I'll explore from there (I already copy through a plugin new authors to the authors library).
Terisa de morgan is offline   Reply With Quote
Old 01-16-2021, 05:17 AM   #1489
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
Thank you, I thought that was the way but I was not sure if there was an automated way. As I have a whole library with authors, that is not polished, I think I'll keep it for a future development... or I'll think for the future authors and I'll explore from there (I already copy through a plugin new authors to the authors library).
Generating the author links is straightforward using the calibre API. For each author in the library, find the book containing that author then write the link to standard output.

The code below generates links to a book for every author in the database. The output is 2-column CSV where column 1 is the author name and col 2 is the link.
Code:
from calibre.library import db as DB
import posixpath

lib_path = sys.argv[1]
lib_name = '_hex_-' + posixpath.basename(lib_path).encode('utf-8').hex()
db = DB(path = lib_path, read_only=True)
cache = db.new_api

# Loop through all the books in the library
author_info = cache.author_data()
for auth_id in author_info:
    auth_books = cache.books_for_field('authors', auth_id)
    print('"{}",calibre://show-book/{}/{}'.format(
            author_info[auth_id]['name'], lib_name, str(next(iter(auth_books)))))
You run this code using
Code:
calibre-debug -e script.py path-to-library
The other side to put the author links into the author table would be similar.
  1. Read the data from above into a link_dict author_name:link
  2. Get the author data
  3. Make a list author_dict of author-name: author_id
  4. Make an empty dict new_link_dict
  5. for each name in link_dict check if the name is in author_dict. If so, add author_id:link to new_link_dict
  6. call cache.set_link_for_authors(new_link_dict)

Last edited by chaley; 01-16-2021 at 05:06 PM. Reason: Forgot script argument to calibre-debug
chaley is offline   Reply With Quote
Old 01-16-2021, 05:49 AM   #1490
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by chaley View Post
Generating the author links is straightforward using the calibre API. For each author in the library, find the book containing that author then write the link to standard output.

The code below generates links to a book for every author in the database. The output is 2-column CSV where column 1 is the author name and col 2 is the link.
Code:
from calibre.library import db as DB
import posixpath

lib_path = sys.argv[1]
lib_name = '_hex_-' + posixpath.basename(lib_path).encode('utf-8').hex()
db = DB(path = lib_path, read_only=True)
cache = db.new_api

# Loop through all the books in the library
author_info = cache.author_data()
for auth_id in author_info:
    auth_books = cache.books_for_field('authors', auth_id)
    print('"{}",calibre://show-book/{}/{}'.format(
            author_info[auth_id]['name'], lib_name, str(next(iter(auth_books)))))
You run this code using
Code:
calibre-debug -e path-to-library
The other side to put the author links into the author table would be similar.
  1. Read the data from above into a link_dict author_name:link
  2. Get the author data
  3. Make a list author_dict of author-name: author_id
  4. Make an empty dict new_link_dict
  5. for each name in link_dict check if the name is in author_dict. If so, add author_id:link to new_link_dict
  6. call cache.set_link_for_authors(new_link_dict)
Thank you! I can do this without problem, so I'll try this evening.
Terisa de morgan is offline   Reply With Quote
Advert
Old 01-16-2021, 04:58 PM   #1491
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by chaley View Post
The other side to put the author links into the author table would be similar.
  1. Read the data from above into a link_dict author_name:link
  2. Get the author data
  3. Make a list author_dict of author-name: author_id
  4. Make an empty dict new_link_dict
  5. for each name in link_dict check if the name is in author_dict. If so, add author_id:link to new_link_dict
  6. call cache.set_link_for_authors(new_link_dict)
Now the dumb question: How can I see this link in the book details? Or does it appears directly?
Terisa de morgan is offline   Reply With Quote
Old 01-16-2021, 05:01 PM   #1492
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
Now the dumb question: How can I see this link in the book details? Or does it appears directly?
In book details the tooltip for the author will show the link. You can see them all in Manage Authors (in the tag browser right-click on authors).
chaley is offline   Reply With Quote
Old 01-17-2021, 04:35 AM   #1493
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thank you! I already have the authors extracted, now to load them.
Terisa de morgan is offline   Reply With Quote
Old 02-03-2021, 08:46 PM   #1494
nixsee
Connoisseur
nixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notes
 
Posts: 79
Karma: 24858
Join Date: Feb 2020
Device: none
I submitted an enhancement request that got denied, so I'm hoping someone here could be of assistance.

I'd love to have additional access to the wonderful new URIs.
1. A keyboard shortcut to copy the link to show/open a book to clipboard
2. A right click context menu option to do the same.

Is there any existing plugin or other option for doing something like this?
nixsee is offline   Reply With Quote
Old 02-03-2021, 09:18 PM   #1495
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,596
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
If you're not already aware, you can right-click on the details pane to copy the Calibre links.
ownedbycats is offline   Reply With Quote
Old 02-04-2021, 07:36 AM   #1496
nixsee
Connoisseur
nixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notes
 
Posts: 79
Karma: 24858
Join Date: Feb 2020
Device: none
Quote:
Originally Posted by ownedbycats View Post
If you're not already aware, you can right-click on the details pane to copy the Calibre links.
Thanks, but I usually have the details pane minimized which is why I'm looking for extra functionality. Either way, a keyboard shortcut would be easier

Edit: looks like kovid reconsidered and added keyboard shortcuts that are off by default but can be customized. I suppose they'll be in tomorrow's release!

Last edited by nixsee; 02-04-2021 at 07:41 AM.
nixsee is offline   Reply With Quote
Old 02-12-2021, 05:24 PM   #1497
CRussel
(he/him/his)
CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.
 
CRussel's Avatar
 
Posts: 12,159
Karma: 79742714
Join Date: Jul 2010
Location: Sunshine Coast, BC
Device: Oasis (Gen3),Paperwhite (Gen10), Voyage, Paperwhite(orig), Fire HD 8
Is there a plugin that allows me to have a book in multiple series? For example, Dana Stabenow has two active series -- Kate Shugak and Liam Campbell. The 19th book in the Kate Shugak series is also the 5th book in the Liam Campbell series. Ideally, I'd like to be able to list it as "Kate Shugak [19.0],Liam Campbell [5.0]" in the series column.
CRussel is offline   Reply With Quote
Old 02-12-2021, 05:46 PM   #1498
compurandom
Guru
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 919
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
Quote:
Originally Posted by CRussel View Post
Is there a plugin that allows me to have a book in multiple series? For example, Dana Stabenow has two active series -- Kate Shugak and Liam Campbell. The 19th book in the Kate Shugak series is also the 5th book in the Liam Campbell series. Ideally, I'd like to be able to list it as "Kate Shugak [19.0],Liam Campbell [5.0]" in the series column.
Only options for that are to either make custom series column to hold the second series, or use tags instead of series.
compurandom is offline   Reply With Quote
Old 02-12-2021, 05:57 PM   #1499
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by CRussel View Post
Is there a plugin that allows me to have a book in multiple series? For example, Dana Stabenow has two active series -- Kate Shugak and Liam Campbell. The 19th book in the Kate Shugak series is also the 5th book in the Liam Campbell series. Ideally, I'd like to be able to list it as "Kate Shugak [19.0],Liam Campbell [5.0]" in the series column.
I'd come at it from a different angle.

Create two books with same title and author but different series, putting the format file(s) into what I regarded as the 'primary book'. And then cross reference and share the content via a calibre://show-book and calibre://view-book links in a #related/Related long text column.

As a reminder to click the view_book link to read the content, colour the book line if it has no formats.

BR
BetterRed is online now   Reply With Quote
Old 02-12-2021, 06:03 PM   #1500
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by compurandom View Post
Only options for that are to either make custom series column to hold the second series, or use tags instead of series.
And then use Grouped search terms (Preferences / Searching / Grouped searches) to combine the standard and custom series columns together for searching.
chaley is offline   Reply With Quote
Reply

Tags
calibre, chatbot, cover, epub fix, epub-fix, google books, kindle, metadata calibre title, missing, pdf, pdf and calibre, plugin development, scribe


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-505 Any ideas what this might be? Neupy Sony Reader 4 07-03-2012 07:19 AM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM
Ideas? mike_bike_kite Which one should I buy? 10 06-13-2010 03:37 PM
Ideas F1Wild Amazon Kindle 4 07-10-2009 06:01 AM


All times are GMT -4. The time now is 03:29 AM.


MobileRead.com is a privately owned, operated and funded community.