Quote:
Originally Posted by Tharos
Is it possible to outsource the section for each domain to a separate file and then read it into FFF?
This would make it possible to use one file for multiple databases. Or to make it available online?
Examples:
[fanfiction.net]
filepath:c:\ffn.net
[fanfiction.net]
url:domain.com/ffn.net
|
Thinking about this some more:
As asked for, an option appearing under a section that will load a file of settings specifically for that section, I don't think is a good idea. That means if you wanted to have shared settings for 2 sites, you'd
have to have different files for each one. IMO, a mechanism to import another file of settings with normal sections is a better choice.
Specifying additional files to load in general inside INI settings is possible, but a bit outside the existing INI paradigm.
Currently, the plugin loads plugin-defaults.ini, then personal.ini from per-library settings while CLI allows the user to load any number of config files as specified by command line options. Each file has the same format with [sections], they are loaded before downloading begins, and precedence is by order of files loaded.
(
(setting)_filelist settings are only loaded when that setting is needed and are not really equivalent. One of the big advantages of _filelist as I see it, is that it
doesn't load a .ini file and therefore doesn't need %% escaping.)
I see three possible implementations:
1. Specify additional INI files to load using a new keyword setting, possibly in a new [section].
Advantages:
- Common to CLI & Plugin.
- Closest to requested feature.
Disadvantages:
- Has to have some sort of recursion prevention.
- Has to be copied to each desired library personal.ini in Calibre.
- User has to create/manage the additional ini file(s) in own text editor.
- User has to put the file somewhere safe and correctly get the file name into personal.ini.
2. Specify additional file(s) to load in plugin settings GUI, likely using a file chooser dialog.
Advantages:
- Parity with CLI --config option.
- Likely easiest to implement.
Disadvantages:
- Has to be set in each desired library in Calibre.
- User has to create/manage the additional ini file(s) in own text editor.
- User has to put the file somewhere safe and correctly find it. Chooser could default to somewhere reasonable.
3. Add a second personal.ini 'file' in plugin that is common and used with all libraries.
Advantages:
- Likely easiest for users.
- Doesn't have to be set in each library.
- Uses existing INI editor.
- No additional files for user to manage.
Disadvantages:
- (Technical issue) Where to put it? Currently all FFF settings are in library db. Probably plugins/PluginName.json?
- Slightly more limited than other options for power users--ie, only one additional common ini file, other options allow for more in more combinations when user has many libraries.
- There will inevitably be users who confuse the per-library and all-libraries personal.inis regardless of how we label them and get unintended results.
- Which should be presented to users, especially new users, as the 'primary' personal.ini? The per-library or all-libraries version?
All in all, I lean towards option 3 as a) the one I'm most likely to use myself and b) the one I'd have to spend the least amount of time explaining.
Opinions?