Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add books in a directory #2

Open
ligurio opened this issue Oct 8, 2020 · 7 comments
Open

Automatically add books in a directory #2

ligurio opened this issue Oct 8, 2020 · 7 comments

Comments

@ligurio
Copy link

ligurio commented Oct 8, 2020

It would be nice to automatically add books in a directory. Now it is possible to add book one by one manually. It's time consuming and boring.

P.S. First of all thanks for sharing source code of bookshelf! It looks very promising. I don't like Calibre and wants something to build OPDS catalog with my books, bookshelf looks interesting.

@altescy
Copy link
Owner

altescy commented Oct 9, 2020

@ligurio

Thank you for using this application.

At the present time, we need to manually input metadata of a book (title, author, etc.) to register into this application.
This is a trouble work as you say.

To realize automatic registration of multiple books, we need to implement a function to extract metadata from a book file.
But, I don't familiar with internal information of a book file such as pdf and epub.
Do you have any ideas or a better solution of this?

@ligurio
Copy link
Author

ligurio commented Oct 9, 2020

@altescy

But, I don't familiar with internal information of a book file such as pdf and epub.
Do you have any ideas or a better solution of this?

EPUB is actually a zip archive with XML documents inside. Metadata stored in XML document too.
I found a couple of packages to extract epub metadata: epub and epubgo (this looks promising). Both requires testing.

PDF is a binary format. I would suggest unipdf package to extract metadata from it. Take a look on examples - https://github.com/unidoc/unipdf-examples/tree/master/metadata

@altescy
Copy link
Owner

altescy commented Oct 9, 2020

@ligurio

Currently bookshelf support the following file formats: azw3, epub, fb2, mobi, pdf, txt.

How about azw3, fb2, and mobi?
It would be awesome if you could tell me some promising packages for these file formats.
(For text file, I plan to use file name as a book title.)

I'm going to implement this feature for future release.
Thank you for your suggestion!

@altescy
Copy link
Owner

altescy commented Oct 9, 2020

I found packages for mobi and fb2:

@ligurio
Copy link
Author

ligurio commented Oct 9, 2020

I don't know any suitable package for azw3 format, but it can be possible to convert azw3 to fb2 and use fb package to extract metadata.

@ckuethe
Copy link

ckuethe commented Aug 12, 2021

To add to this feature request, it would be nice to recursively scan a directory, even to just barely populate the database with filename, size, and sha256.

I've already scanned all the books and built a json file full of metadata, and I could very easily update the bookshelf database with missing metadata either by directly editing the database or using the API

@marek-lach
Copy link

I found packages for mobi and fb2:

* mobi: https://github.com/clee/gobipocket

* fb2: https://github.com/centrypoint/fb2

Other, currently updated fb2 parsers for go that could be used:

https://github.com/karantin2020/go-fb2

or

https://github.com/vdovindima/fb2

or https://github.com/rupor-github/fb2converter also provides .mobiconversion capabilities too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants