summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-10-05 15:58:40 +0200
committerraveit65 <[email protected]>2020-10-17 17:55:40 +0200
commit84fb5cfe96263f79e50b68a5a6996e40c514cf74 (patch)
tree83fd1f200a490996a556b77f5c77d4b3f112e3a1 /src
parent6408a9a684e3fca9a9cae893759f1a8a807df5b2 (diff)
downloadengrampa-84fb5cfe96263f79e50b68a5a6996e40c514cf74.tar.bz2
engrampa-84fb5cfe96263f79e50b68a5a6996e40c514cf74.tar.xz
Add Electronic Publication (EPUB) support
$ file -b --mime-type don-quijoti-epub3.epub application/epub+zip
Diffstat (limited to 'src')
-rw-r--r--src/fr-command-7z.c6
-rw-r--r--src/fr-command-zip.c1
-rw-r--r--src/fr-init.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index bd8406b..796e03a 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -578,7 +578,8 @@ fr_command_7z_handle_error (FrCommand *comm,
}
-const char *sevenz_mime_types[] = { "application/x-7z-compressed",
+const char *sevenz_mime_types[] = { "application/epub+zip",
+ "application/x-7z-compressed",
"application/x-arj",
"application/vnd.ms-cab-compressed",
"application/x-cd-image",
@@ -641,7 +642,8 @@ fr_command_7z_get_capabilities (FrCommand *comm,
else
capabilities |= FR_COMMAND_CAN_READ;
- if (is_mime_type (mime_type, "application/x-cbz")
+ if (is_mime_type (mime_type, "application/epub+zip")
+ || is_mime_type (mime_type, "application/x-cbz")
|| is_mime_type (mime_type, "application/x-ms-dos-executable")
|| is_mime_type (mime_type, "application/zip"))
{
diff --git a/src/fr-command-zip.c b/src/fr-command-zip.c
index f16cc9a..9469e91 100644
--- a/src/fr-command-zip.c
+++ b/src/fr-command-zip.c
@@ -382,6 +382,7 @@ fr_command_zip_handle_error (FrCommand *comm,
const char *zip_mime_type[] = {
+ "application/epub+zip",
"application/vnd.oasis.opendocument.presentation",
"application/vnd.oasis.opendocument.spreadsheet",
"application/vnd.oasis.opendocument.text",
diff --git a/src/fr-init.c b/src/fr-init.c
index 850df07..7d7b313 100644
--- a/src/fr-init.c
+++ b/src/fr-init.c
@@ -66,6 +66,7 @@ FrMimeTypeDescription mime_type_desc[] = {
{ "application/vnd.oasis.opendocument.presentation-template", ".otp", N_("OpenDocument Presentation Template"), 0 },
{ "application/vnd.oasis.opendocument.spreadsheet-template", ".ots", N_("OpenDocument Spreadsheet Template"), 0 },
{ "application/vnd.oasis.opendocument.text-template", ".ott", N_("OpenDocument Text Template"), 0 },
+ { "application/epub+zip", ".epub", N_("Electronic Publication"), 0 },
{ "application/x-7z-compressed", ".7z", N_("7-Zip"), 0 },
{ "application/x-7z-compressed-tar", ".tar.7z", N_("Tar compressed with 7z"), 0 },
{ "application/x-ace", ".ace", N_("Ace"), 0 },
@@ -133,6 +134,7 @@ FrExtensionType file_ext_type[] = {
{ ".cpio", "application/x-cpio" },
{ ".deb", "application/vnd.debian.binary-package" },
{ ".ear", "application/x-ear" },
+ { ".epub", "application/epub+zip" },
{ ".exe", "application/x-ms-dos-executable" },
{ ".gz", "application/x-gzip" },
{ ".iso", "application/x-cd-image" },