Yay, the server beta is finally released! Now I can stop promising people that "it's supposed to be coming soon, your long-awaited bookmarks/annotations paradise is nigh".
Quote:
Originally Posted by latepaul
At home I've got a script I use to add books and populate custom columns with initial values. It uses calibredb a lot - so I'll try that when I get back.
|
It would probably be a lot more efficient to write it in python using `calibre-debug` to run it. You can use the
database API.
Example snippet to initialize your library so you can modify it via the "cache" object:
Code:
#!/usr/bin/calibre-debug
def init_cache(library_path=None):
if library_path:
from calibre.utils.filename import import expanduser
library_path = expanduser(library_path)
else:
from calibre.utils.config import prefs
library_path = prefs['library_path']
from calibre.db.backend import DB
from calibre.db.cache import Cache
backend = DB(library_path)
cache = Cache(backend)
cache.init()
return cache
cache = init_cache()