I recently started using the WebUI to add books to my library via a web browser, it is just easier for some of my family members, but there is the occasional issue with a book being tagged wrong. I was hoping to fix this via command line, as I run Calibre on a headless server, using a combination of calibredb and fetch-ebook-metadata. I'll outline the script I put together below to fix it, which it does seem to do as far as calibredb returns, but the WebUI does not seem to reflect these changes. Am I missing something, is there another command that I should be running to get the library to realize there was an update?
Code:
#!/bin/bash
LIBPATH="$1"
BOOKID="$2"
AUTHOR="$3"
TITLE="$4"
fetch-ebook-metadata -t "$TITLE" -a "$AUTHOR" -o | tee temp.opf
calibredb --with-library "$LIBPATH" set_metadata $BOOKID temp.opf
calibredb embed_metadata $BOOKID --with-library "$LIBPATH"
rm temp.opf
Here is an example from calibredb of what a book was tagged incorrectly:
Code:
Title : The Magic of Recluce
Title sort : Magic of Recluce, The
Author(s) : L. E. Modesitt, Jr. [L. E. Modesitt, Jr.]
Publisher : Macmillan
Languages : eng
Timestamp : 2019-07-31T20:33:12+00:00
Published : 2010-07-01T00:00:00+00:00
Identifiers : sonybookid:CBUSCEHOL02U6Y0P
Formats : EPUB
And here it is from calibredb after being fixed:
Code:
Title : The Evertree
Title sort : Evertree, The
Author(s) : Marie Lu
Publisher : Scholastic Australia
Tags : Juvenile Fiction, Fantasy & Magic
Languages : eng
Timestamp : 2019-07-31T20:33:12+00:00
Published : 2015-04-01T20:34:50+00:00
Identifiers : google:2HmpBwAAQBAJ, isbn:9781925063776
Comments : Everything comes to a head in this seventh book in the New York Times bestselling series. The world of Erdas will be changed forever. Conor, Abeke, Meilin, and Rollan were once ordinary kids. Then they discovered that they had spirit animals-wise and powerful partners who granted them with amazing gifts … and a legendary responsibility. Together, the team has journeyed across Erdas, racing to stop a merciless foe. They have laughed and fought together. They've won challenges and lost friends. Some have even lost themselves. Now that journey is about to end. They must reach a place forgotten by time and face off against an ancient enemy breaking free from his prison. They have just one chance to stop him … or the whole world will shatter.
Formats : EPUB