Skip to content

Commit 852d4d7

Browse files
committed
Fixed #181: using application/epub+zip mime for .epub files
1 parent 0b787f0 commit 852d4d7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ as of 2.0.0.
1515
- Fixed `Language` metadata (and filename) for multilang ZIMs (#174)
1616
- Using zimscraperlib 2.1.0
1717
- Using localized Title and Description metadata (#148)
18+
- Fixed regression with epub files stored as `application/zip` (#181)
1819

1920
## [2.0.0] - 2023-02-20
2021

gutenbergtozim/shared.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def inc_progress():
3434

3535
@staticmethod
3636
def setup(filename, language, title, description, name):
37-
3837
Global.creator = Creator(
3938
filename=filename,
4039
main_path="Home.html",
@@ -62,8 +61,9 @@ def add_item_for(
6261
delete_fpath: Optional[bool] = False,
6362
callback: Optional[Union[callable, Tuple[callable, Any]]] = None,
6463
):
65-
6664
logger.debug("\t\tAdding ZIM item at {}".format(path))
65+
if not mimetype and path.endswith(".epub"):
66+
mimetype = "application/epub+zip"
6767
with Global._lock:
6868
Global.creator.add_item_for(
6969
path=path,

0 commit comments

Comments
 (0)