Closed onnyyonn closed 3 years ago
calibredb.el
? If it is ok, maybe your metadata was broken. .sqliterc
is existed or not? Try to delete .sqliterc
and try again. Post the content of .sqliterc
here.INVALID LIBRARY
error..sqliterc
in my home directory.What operating system do you use? If your are windows, is it using utf8, try to enable utf8?
Would you like to switch to calibredb.el 2.8.0 and test again? 2.9.0 was just released yesterday and maybe some bugs on it.
Try to send the metadata.db to me (you can upload to github) and I will test on it.
I am using Manjaro Linux with KDE Plasma. It is using UTF-8.
I tried calibredb.el 2.8.0. The error persists still. In case it matters, I am using Doom Emacs and this is how the installation looks like in my packages.el
:
(package! calibredb :pin "a62d7de582b16490b1af5add7b24a67022be531b")
Here is metadata.db.zip
(Thanks for your patience to solve this issue btw. Really appreciate it.)
I've download the latest calibre 5.13 and latest sqite3 3.35.2, and set them with
(setq calibredb-program "/Users/chandamon/Downloads/calibre.app/Contents/MacOS/calibredb")
(setq sql-sqlite-program "/Users/chandamon/Downloads/sqlite-tools-osx-x86-3350200/sqlite3")
and tested your metadata.db, it works perfectly.
Would you try to set calibredb-program
and sql-sqlite-program
in your config and try?
I have tried a few things, like updating Calibre and Sqlite and setting calibredb-program
and sql-sqlite-program
in the config. They didn't help. But finally I made it work by removing :defer t
from the config. I have no idea why that would happen though.
Anyway, the package is working for me now. Please feel free to close the issue.
Some more info on this bug:
I tried the following config to see if I can use it with defer
(use-package calibredb
:defer t
:init
(autoload 'calibredb "calibredb")
(setq calibredb-root-dir "~/Nextcloud/Books/Calibre/")
(setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
(setq calibredb-library-alist '(("~/Nextcloud/Books/Calibre/")))
(setq calibredb-format-all-the-icons t))
And it works. But there is one issue - the function calibredb
is not there anymore! All other functions such as calibredb-find-counsel
, calibredb-list
etc. are still there and works as expected.
@onnyyonn Although I don't know why adding that autoload
form in the :init
would make the calibredb
function unavailable, you shouldn't need that autoload
form as the calibredb
function already has a "magic" comment to make it autoloadable,
Also, just for your information, if you do want/need to make a function autoloadable via the use-package
macro then you can use the :command
keyword for that as documented here (note that it additionally mentions that you do not need the :defer
keyword when you are using the :command
keyword).
@dalanicolai thanks for the suggestions. It seems removing the autoload
fixes all problems. Right now my cofig looks like this:
(use-package calibredb
:defer t
:config
(setq calibredb-root-dir "~/Nextcloud/Books/Calibre/")
(setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
(setq calibredb-library-alist '(("~/Nextcloud/Books/Calibre/")))
(setq calibredb-format-all-the-icons t))
and everything is working as intended. By the way, I think the Readme should be updated with removing the autoload
, as it's not needed and may cause issues.
Ah yes, you are right. I'm sure @chenyanming will take care of this...
Anyway great that it works now... enjoy this great package!
README was updated. Now it can be closed.
My config looks like this:
I can confirm that
calibredb
andsqlite3
are in system path (\usr\bin
).metadata.db
exists in the directory~/Nextcloud/Books/Calibre/
, which is bothcalibredb-root-dir
andcalibredb-library
for me. I have also looked at the suggestions given at #6 and #15 . I still getINBALID LIBRARY
error when I try to runcalibredb-find-counsel
.