Download multiple files as zip

This commit is contained in:
eikek
2022-04-09 14:01:36 +02:00
parent e65b8de686
commit 4488291319
55 changed files with 2328 additions and 38 deletions

View File

@ -0,0 +1,49 @@
{-
Copyright 2020 Eike K. & Contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-}
module Data.DownloadAllState exposing (DownloadAllState(..), all, asString, fromString)
type DownloadAllState
= NotPresent
| Forbidden
| Empty
| Preparing
| Present
all : List DownloadAllState
all =
[ NotPresent, Forbidden, Empty, Preparing, Present ]
asString : DownloadAllState -> String
asString st =
case st of
NotPresent ->
"notpresent"
Forbidden ->
"forbidden"
Empty ->
"empty"
Preparing ->
"preparing"
Present ->
"present"
fromString : String -> Maybe DownloadAllState
fromString str =
let
name =
String.toLower str
in
List.filter (\e -> asString e == name) all |> List.head

View File

@ -0,0 +1,41 @@
{-
Copyright 2020 Eike K. & Contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-}
module Data.DownloadFileType exposing (DownloadFileType(..), all, asString, fromString)
type DownloadFileType
= Converted
| Originals
all : List DownloadFileType
all =
[ Converted, Originals ]
asString : DownloadFileType -> String
asString ft =
case ft of
Converted ->
"converted"
Originals ->
"original"
fromString : String -> Maybe DownloadFileType
fromString str =
case String.toLower str of
"converted" ->
Just Converted
"originals" ->
Just Originals
_ ->
Nothing

View File

@ -35,6 +35,8 @@ type alias Config =
, maxPageSize : Int
, maxNoteLength : Int
, showClassificationSettings : Bool
, downloadAllMaxFiles : Int
, downloadAllMaxSize : Int
, openIdAuth : List OpenIdAuth
}