janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
13.05k stars 1.39k forks source link

[Feature Request] Auto Add/Scan Books #344

Closed mccorkled closed 7 years ago

mccorkled commented 7 years ago

Could you please add a feature to scan a particular directory every x hours to auto add or remove books?

Thank you. :)

OzzieIsaacs commented 7 years ago

I entered a suggestion in the first issue to solve this via bash script, this feature is beyond the scope of the project

mccorkled commented 7 years ago

Running a program frequently isn't a solution to something that should be automated.

kianrafiee commented 6 years ago

The problem with this shell script work-around is that it doesn't take into account downloads from LL that are not finished yet. So the script could pull something that hasn't completely downloaded and therefore the file will be corrupted.

OzzieIsaacs commented 6 years ago

What is LL? And how should Calibre-web detect that the download isn‘t finished?

kianrafiee commented 6 years ago

Actually I want to backtrack and point out that I was wrong. LL(LazyLibrarian) can move finished files to a different folder so no problems their. But the shell script is dependent on calibredb which calibre-web does not include. I, along with others, therefore cannot use it on a NAS such as Synology using docker.

But I feel this wouldn’t be hard to implement in caliber-web. You already have a bulk upload function. So having a call to that function on a “watch” folder would be pretty easy to implement imo. I wish I knew enough python to do it right now. Sorry I can’t be of much more help atm.

bodybybuddha commented 6 years ago

@kianrafiee - Here's a possible alternative: you can certainly use calibre in a docker. Check out aptalca/docker-rdp-calibre. Allows you to use a web browser to access calibre. I use it on my Ubuntu server with a docker for calibre-web - all sharing the same db and book collection.

I haven't tried the watch folder in the calibre image above, but I don't see any reason why it couldn't be done. The docker image does have the ability to expose the calibre-server - so I'm sure it may be as simple as adding a mount point for the watch folder and configure calibre appropriately.

Another solution is to look into @technosoft2000's calibre-web docker image. It does include a copy of calibre for the purpose of using ebook-convert. Maybe the bash solution could be used in that image? Not sure what the requirements are for the tool.

Give the first docker image a shot and see where you go from there. Post back here on your results if you could to help others out. If we can get this solution to work without adding to the code base of calibre-web - that would be awesome!

kianrafiee commented 6 years ago

Thanks I will hopefully try tomorrow and keep you all up to date. One thing: how would calibre-web play nicely with the calibre db when it has its own book db to worry about?

kianrafiee commented 6 years ago

I think this is user error. Will update you all tomorrow!

kianrafiee commented 6 years ago

Here is what I posted in LL repo:

Yep! It was user error. I didn't realize I changed the book folder for LL. It wasn't the one with the metadata file used by calibre-web(and calibre for that matter). So far its slowly importing books and I am pleasantly surprised at the exceptional sorting/organizing of files.

Only thing to check last is whether calibre-web will see some books I never uploaded to it but that are in the books folder and being processed by LL shortly.

And on that note, I believe their should be some documentation added to LL and Calibre-web so other users are aware of the inherent cross-syncing of the two apps. I spent way too much time fixing a problem that never was. I blame myself but google searches made it seem like this was a problem. No bad on you or anyone else. Just my suggestion.

kianrafiee commented 6 years ago

So no need to configure anything. Just point both apps to same book dir.

jmarmstrong1207 commented 3 months ago

I entered a suggestion in the first issue to solve this via bash script, this feature is beyond the scope of the project

I don't fully understand why this is beyond the scope of the project. Books can be converted to multiple formats, be imported individually with the uploads button, and be synced with Kobo. Why isn't an option to have auto importing in scope? Not sure if the project was different 7 years ago, but this feature would be loved by a ton of people. Even a button to manually import all non-imported books would be amazing!

There are many workarounds to this online solely because this is the best program for a selfhosted calibre server, but the server itself can't natively import its own books. There is a fork specifically for this feature too

Edit: I have fixed the current auto import script in the wiki page so that it waits for files to write before importing.