Skip to content

Commit dab7b11

Browse files
committed
Use new StaticItem parameters for add_item_for
1 parent d2895ee commit dab7b11

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/zimscraperlib/zim/creator.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,6 @@ def add_item_for(
303303
if should_compress is not None:
304304
hints[libzim.writer.Hint.COMPRESS] = should_compress
305305

306-
kwargs = {
307-
"path": path,
308-
"title": title or "",
309-
"mimetype": mimetype,
310-
"filepath": fpath if fpath is not None else "",
311-
"hints": hints,
312-
"content": content,
313-
}
314306
if delete_fpath and fpath:
315307
cb = [delete_callback, fpath]
316308
if callback and callable(callback):
@@ -320,7 +312,16 @@ def add_item_for(
320312
callback = tuple(cb)
321313

322314
self.add_item(
323-
StaticItem(**kwargs), callback=callback, duplicate_ok=duplicate_ok
315+
StaticItem(
316+
path=path,
317+
title=title,
318+
mimetype=mimetype,
319+
filepath=fpath,
320+
hints=hints,
321+
content=content,
322+
),
323+
callback=callback,
324+
duplicate_ok=duplicate_ok,
324325
)
325326
return path
326327

0 commit comments

Comments
 (0)