0 Developer's corner
Derek Broughton edited this page 2023-09-28 16:49:03 -03:00

Developer's corner

Add metadata provider

Calibre-Web will not be extended by any more metadata providers to download books metadata, but anybody is free to generate their own metadata provider and make it available to the public. Generate a new .py file in the cps/metadata_provider folder. The file will be read during the next start of Calibre-Web. The file must have a class derived from Metadata and has to have a method named search returning a list of MetaRecord. Working examples can be found in the metadata_provider folder. Don't forget to add your file to the excluded files during update (check next chapter).

Exclude files from being overwritten during update

If you have extended Calibre-Web somehow with new files, these files will be overwritten during the next manual run of program internal updater. To prevent this, add your files in the exclude.txt file in the root directory of Calibre-Web. Please use one file or directory per line. Calibre-Web's root folder acts as root folder for this file. / or ** can act as path separators, paths with spaces can be enclosed by " or '. By default all Calibre-Web settings databases and default logfiles are excluded from being overwritten.
Examples:
/logfile
Will exclude a file or a folder named logfile from being overwritten during update process.
/random path/except.txt
Will exclude a file named except.txt in the random path directory from being overwritten during update process.

To check if anything works out well, a dry run of the updater can be started by starting Calibre-Web with the -d parameter. Calibre-Web will check beside several other stuff if all files in exclude.txt are available.