|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2019
Device: Kindle
|
![]()
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 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 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 |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to connect to the server using a server URL for --with-library are you doing that? And be running a version of calibre > 3
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2019
Device: Kindle
|
I'm actually on the server itself via SSH, the library variable is provided via the command line when I run the script, which is the actual path to the library directory itself, not the url for it. Is this not valid as it seems to work for updating the data in the DB.
The version of Calibre on the server is 3.46.0, I don't run Calibre locally as it would be redundant. As an example to what I'm passing to the bash script, I've included the commands as they would be run. Code:
updateBook /mnt/data/books 214 "Under Same Sky" "Cynthia DeFelice" Code:
fetch-ebook-metadata -t "Under Same Sky" -a "Cynthia DeFelice" -o | tee temp.opf calibredb --with-library "/mnt/data/books" set_metadata 214 temp.opf calibredb --with-library "/mnt/data/books" embed_metadata 214 |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the URL to the server, not the library path. See the details at https://manual.calibre-ebook.com/gen...calibredb.html
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2019
Device: Kindle
|
OK, figured out the issue and it seems to be a weird permissions issue I was having, where Calibre was creating a folder but the umask was too restrictive to allow the creation of files properly. No idea why it appeared to be fixed after a reboot, but added new umask to the service and it is all right as rain now.
As a side note, it works when you specify either the library location or the URL now. Cheers for the help mate! |
![]() |
![]() |
Advert | |
|
![]() |
Tags |
calibredb calibre-server |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New fetch-ebook-metadata errors | plo233 | Calibre | 6 | 08-24-2018 11:14 PM |
fetch-ebook-metadata.exe python error | dzog | Calibre | 2 | 11-04-2016 05:26 AM |
calibredb add metadata issue | vir_db | Library Management | 0 | 07-21-2014 07:12 AM |
calibredb command line question (setting metadata) | mezme | Calibre | 0 | 12-06-2011 12:17 AM |
Can Excel SQL query get metadata out of calibredb? | unboggling | Calibre | 24 | 01-20-2011 02:45 AM |