@@ -314,7 +314,7 @@ cdef class _Creator:
314314 with nogil:
315315 self .c_creator.addItem(item)
316316
317- def add_metadata (self , str name: str , bytes content: bytes , str mimetype: str = " text/plain;charset=UTF-8 " ):
317+ def add_metadata (self , str name: str , bytes content: bytes , str mimetype: str ):
318318 """ Add metadata entry to Archive
319319
320320 https://wiki.openzim.org/wiki/Metadata"""
@@ -475,14 +475,15 @@ class Creator(_Creator):
475475 return super ().config_compression(compression)
476476
477477 def add_metadata (
478- self , name: str , content: Union[str , bytes , datetime.date , datetime.datetime]
478+ self , name: str , content: Union[str , bytes , datetime.date , datetime.datetime],
479+ mimetype: str = " text/plain;charset=UTF-8"
479480 ):
480481 name = pascalize(name)
481482 if name == " Date" and isinstance (content, (datetime.date, datetime.datetime)):
482483 content = content.strftime(" %Y -%m -%d " ).encode(" UTF-8" )
483484 if isinstance (content, str ):
484485 content = content.encode(" UTF-8" )
485- super ().add_metadata(name = name, content = content)
486+ super ().add_metadata(name = name, content = content, mimetype = mimetype )
486487
487488 def __repr__ (self ) -> str:
488489 return f"Creator(filename = {self .filename})"
0 commit comments