Feature request: individual folder per library for auto adding

Bug #1073214 reported by Jerry Preissler
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
calibre
Won't Fix
Undecided
Jerry Preissler

Bug Description

Currently you can set a directory to automatically add books from in Preferences -> Adding books -> Automatic Adding but when switching to a different library this setting is not changed. With multiple libraries this means that the user needs to switch to the correct library before a book is placed in this directory.

It would greatly enhance my workflow when adding new books if Calibre supported this setting on a per-library basis so that I can sort books into different libraries by placing them in the corresponding directories.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1073214

This is not worth the effort for me personally. If some one else wants to implement it, I will be happy to supply any needed guidance. If so, re-open the ticket and we can discuss it.

 status wontfix

Changed in calibre:
status: New → Won't Fix
Revision history for this message
Jerry Preissler (gerald-preissler) wrote :

Ok, I'll bite and give it a try. No promises though, my Python is beyond rusty and I have little free time.

If possible I'd avoid mucking with the GUI for now, so what about this idea:

In addition to checking the configured folder to autoload books from, the program also checks if there is a subfolder that is named like the currently active library. If it finds such a file it autoloads any books it finds in there as well.

With this approach no changes to the UI are required. As an added bonus the current behaviour of the feature basically remains the same. The only problem I could see is someone keeping books in subfolders of the auto import dir that he does not want to import.

What do you think?

I've cloned the sources and added a short print statement to check that I'm actually working with the updated version as suggested on the webpage. Could you give me a pointer where I could find the code that handles the automatic import and how I could access the name of the currently active library?

Changed in calibre:
assignee: nobody → Jerry Preissler (gerald-preissler)
Kovid Goyal (kovid)
Changed in calibre:
status: Won't Fix → In Progress
Revision history for this message
Kovid Goyal (kovid) wrote :

Sounds ok to me, if you implement it, I'll add a checkbox to the preferences to activate/de-activate it. It can default to unactivated so it wont cause any surprises.

gui2/auto_add.py is where the auto add code lives

You will also need to handle the case of the current library being changed in the GUI, for which you will need to add some code to library_moved() in gui2/ui.py.

To set the initial library folder add code to the end of initialize() in gui2/ui.py

You can get the library name as

os.path.basename(db.library_path)

Revision history for this message
Kovid Goyal (kovid) wrote :

no followup.

Changed in calibre:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.