Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-26-2020, 05:53 PM   #1
RG9400
Junior Member
RG9400 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jun 2018
Device: None
Add custom column via calibre server

I am trying to use a running calibreserver to create a custom column. I saw that there is an option to route commands to calibredb, so I ran an example query below

http://iport/cdb/cmd/add_custom_column

with this payload

Code:
{
    "label": "page_count",
    "name": "page_count",
    "datatype": "int"
}
This errors out with the below error

Code:
{
    "tb": "Traceback (most recent call last):\n  File \"site-packages\\calibre\\srv\\cdb.py\", line 58, in cdb_run\n  File \"site-packages\\calibre\\db\\cli\\cmd_add_custom_column.py\", line 19, in implementation\nNotImplementedError\n",
    "err": ""
}
The reason is that I think the command is actually set to say it is not implemented, even though it seems to work via calibredb directly (src: https://github.com/kovidgoyal/calibr..._column.py#L17)

Is there any reason that it raises the NotImplemented error? Can it be added if it is not already functional? The main goal would be to remove the need for my docker container to contain the calibredb binary and still be able to interact with a running server. End goal is to create a page count column if one does not already exist.
RG9400 is offline   Reply With Quote
Old 08-26-2020, 11:05 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Adding a custom column requires a database reload, which is not implemented for the server. If you run the command using actual calibredb, you will get the message:

The add_custom_column command is not supported with remote (server based) libraries

Last edited by kovidgoyal; 08-26-2020 at 11:17 PM.
kovidgoyal is offline   Reply With Quote
Advert
Reply

Tags
api


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use custom column and tag on calibre-server? yourrable Server 2 12-16-2018 03:26 AM
Add Custom Column To Category Side Panel TashPerth Library Management 3 04-25-2017 11:10 AM
Documentation: How to Add a New Custom Column Datatype DaltonST Development 7 07-03-2016 12:51 PM
Is there a way to add the metadata AND also the filename in a custom column? LadyKate Library Management 5 10-10-2014 01:13 PM
Custom Column on Content Server: 404 Not Found annekaelber Calibre 14 04-05-2014 04:39 AM


All times are GMT -4. The time now is 08:48 PM.


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