From 736520e5e17eee490565c98cd037363fd3e34aed Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 31 Oct 2022 00:14:07 +0100 Subject: compiler,viewer: register EPUB item type --- compiler/src/ItemProcessors.hs | 5 ++++- compiler/src/Resource.hs | 1 + viewer/src/@types/gallery.ts | 6 ++++++ viewer/src/@types/itemType.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/compiler/src/ItemProcessors.hs b/compiler/src/ItemProcessors.hs index fa99316..6035477 100644 --- a/compiler/src/ItemProcessors.hs +++ b/compiler/src/ItemProcessors.hs @@ -1,7 +1,7 @@ -- ldgallery - A static generator which turns a collection of tagged -- pictures into a searchable web gallery. -- --- Copyright (C) 2019-2021 Pacien TRAN-GIRARD +-- Copyright (C) 2019-2022 Pacien TRAN-GIRARD -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as @@ -38,6 +38,7 @@ data Format = | PlainTextFormat | MarkdownFormat | PortableDocumentFormat + | EPUBFormat | VideoFormat | AudioFormat | Unknown @@ -59,6 +60,7 @@ formatFromPath = ".txt" -> PlainTextFormat ".md" -> MarkdownFormat ".pdf" -> PortableDocumentFormat + ".epub" -> EPUBFormat ".wav" -> AudioFormat ".oga" -> AudioFormat ".ogg" -> AudioFormat @@ -103,6 +105,7 @@ itemFileProcessor maxResolution = processorFor PlainTextFormat _ = copyResource PlainText processorFor MarkdownFormat _ = copyResource Markdown processorFor PortableDocumentFormat _ = copyResource PDF + processorFor EPUBFormat _ = copyResource EPUB processorFor VideoFormat _ = copyResource Video processorFor AudioFormat _ = copyResource Audio processorFor Unknown _ = copyResource Other diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs index 804c9a1..1868512 100644 --- a/compiler/src/Resource.hs +++ b/compiler/src/Resource.hs @@ -92,6 +92,7 @@ data GalleryItemProps = | PlainText { resource :: Resource } | Markdown { resource :: Resource } | PDF { resource :: Resource } + | EPUB { resource :: Resource } | Video { resource :: Resource } | Audio { resource :: Resource } | Other { resource :: Resource } diff --git a/viewer/src/@types/gallery.ts b/viewer/src/@types/gallery.ts index 8c0f177..6960de2 100644 --- a/viewer/src/@types/gallery.ts +++ b/viewer/src/@types/gallery.ts @@ -64,6 +64,9 @@ export interface MarkdownProperties extends Downloadable { export interface PDFProperties extends Downloadable { type: ItemType.PDF; } +export interface EPUBProperties extends Downloadable { + type: ItemType.EPUB; +} export interface VideoProperties extends Downloadable { type: ItemType.VIDEO; } @@ -107,6 +110,9 @@ export interface MarkdownItem extends Item { export interface PDFItem extends Item { properties: PDFProperties; } +export interface EPUBItem extends Item { + properties: EPUBProperties; +} export interface VideoItem extends Item { properties: VideoProperties; } diff --git a/viewer/src/@types/itemType.ts b/viewer/src/@types/itemType.ts index ecab05c..8528728 100644 --- a/viewer/src/@types/itemType.ts +++ b/viewer/src/@types/itemType.ts @@ -23,6 +23,7 @@ export enum ItemType { PLAINTEXT = 'plaintext', MARKDOWN = 'markdown', PDF = 'pdf', + EPUB = 'epub', VIDEO = 'video', AUDIO = 'audio', DIRECTORY = 'directory', -- cgit v1.2.3