DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
732 stars 71 forks source link

Enhancement: Configure whether you want opf provided tags imported into Calibre #1621

Closed jcal22 closed 5 years ago

jcal22 commented 5 years ago

Lots of files have junk tags in the opf files. I'd like to make an option to ignore those junk tags when importing into calibre.

I don't mind tackling this, but need 10,000 ft. overview of adding stuff to config.ini. How do i add a line and default value for a new variable in config.ini programatically?

philborman commented 5 years ago

Quite straightforward, just define it in init.py I guess you want a bool, so you would add a line in the CONFIG_DEFINITIONS section 'OPF_TAGS': ('bool', 'General', 1), where General is the config section and 1 is the default value Next time you start the program the default value is used until you change it and save config. Only gets written to config.ini on save, if you don't save the same default gets used next time.

You probably also want a tickbox in config.html, either bookstrap interface or both. If you don't want to support the legacy interface, add OPF_TAGS to the CONFIG_NONDEFAULT section so users on the old interface always use the inbuilt default If you don't want a tickbox at all so the value is only editable in config.ini add OPF_TAGS to the CONFIG_NONWEB section