Skip to content

Commit

Permalink
Add constants for bloom books(.bloompub)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkuAg committed Jun 5, 2024
1 parent cf687be commit c66a592
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions le_utils/constants/content_kinds.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
file_formats.HTML5: HTML5,
file_formats.H5P: H5P,
file_formats.ZIM: ZIM,
file_formats.BLOOMPUB: DOCUMENT,
}


Expand Down
1 change: 1 addition & 0 deletions le_utils/constants/embed_content_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"slideshow_thumbnail",
"slideshow_manifest",
"imscp_zip",
"bloompub",
],
},
"file": {
Expand Down
5 changes: 5 additions & 0 deletions le_utils/constants/file_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
EPUB = "epub"
EPUB_MIMETYPE = "application/epub+zip"

# constants for bloomPub format
BLOOMPUB = "bloompub"
BLOOMPUB_MIMETYPE = "application/bloompub+zip"

choices = (
(MP4, "MP4 Video"),
(WEBM, "WEBM Video"),
Expand All @@ -94,6 +98,7 @@
(H5P, "H5P"),
(ZIM, "ZIM"),
(EPUB, "ePub Document"),
(BLOOMPUB, "bloom Document"),
)


Expand Down
2 changes: 2 additions & 0 deletions le_utils/constants/file_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
THUMBNAIL = "thumbnail"
SUBTITLES = "subtitles"
SLIDESHOW_IMAGE = "slideshow_image"
BLOOMPUB = "bloompub"


""" File Format (extension) to File Type Mapping """
Expand All @@ -28,6 +29,7 @@
# DocumentFile formats
file_formats.PDF: DOCUMENT,
file_formats.EPUB: EPUB,
file_formats.BLOOMPUB: BLOOMPUB,
#
# formats HTMLZipFile
file_formats.HTML5: HTML5,
Expand Down
3 changes: 3 additions & 0 deletions le_utils/constants/format_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
EPUB_READABLE = "ePub Document"
DOCUMENT_THUMBNAIL = "document_thumbnail"
DOCUMENT_THUMBNAIL_READABLE = "Thumbnail"
BLOOMPUB = "bloompub"
BLOOMPUB_READABLE = "Bloom Document"

EXERCISE = "exercise"
EXERCISE_READABLE = "Exercise"
Expand Down Expand Up @@ -118,6 +120,7 @@
(SLIDESHOW_THUMBNAIL, SLIDESHOW_THUMBNAIL_READABLE),
(SLIDESHOW_MANIFEST, SLIDESHOW_MANIFEST_READABLE),
(IMSCP_ZIP, IMSCP_ZIP_READABLE),
(BLOOMPUB, BLOOMPUB_READABLE),
)


Expand Down
3 changes: 3 additions & 0 deletions le_utils/resources/formatlookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@
},
"zip": {
"mimetype": ".zip"
},
"bloompub": {
"mimetype": "application/blommpub+zip"
}
}
12 changes: 12 additions & 0 deletions le_utils/resources/presetlookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,5 +358,17 @@
"kind": "slideshow",
"allowed_formats": ["json"],
"convertible_formats": []
},
"bloompub": {
"readable_name": "Bloom Document",
"multi_language": false,
"supplementary": false,
"thumbnail": false,
"subtitle": false,
"display": true,
"order": 1,
"kind": "document",
"allowed_formats": ["bloompub"],
"convertible_formats": []
}
}
3 changes: 2 additions & 1 deletion spec/schema-embed_content_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"slideshow_image",
"slideshow_thumbnail",
"slideshow_manifest",
"imscp_zip"
"imscp_zip",
"bloompub"
]
},
"file": {
Expand Down

0 comments on commit c66a592

Please sign in to comment.