diff --git a/src/calibre/ebooks/metadata/meta.py b/src/calibre/ebooks/metadata/meta.py index c6d3cf479a..f2c31a538d 100644 --- a/src/calibre/ebooks/metadata/meta.py +++ b/src/calibre/ebooks/metadata/meta.py @@ -83,7 +83,7 @@ def get_metadata(stream, stream_type='lrf', use_libprs_metadata=False): return base def set_metadata(stream, mi, stream_type='lrf'): - if stream_type: + if stream_type: stream_type = stream_type.lower() set_file_type_metadata(stream, mi, stream_type) diff --git a/src/calibre/manual/customize.rst b/src/calibre/manual/customize.rst index 3c00787881..0efb6a3f63 100644 --- a/src/calibre/manual/customize.rst +++ b/src/calibre/manual/customize.rst @@ -46,7 +46,7 @@ Create a file name :file:`my_plugin.py` (the file name must end with plugin.py) ext = os.path.splitext(path_to_ebook)[-1][1:].lower() mi = get_metadata(file, ext) mi.publisher = 'Hello World' - set_metadata(file, ext, mi) + set_metadata(file, mi, ext) return path_to_ebook That's all. To add this code to |app| as a plugin, simply create a zip file with::