Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
Media Converter
Commits
565383e0
Unverified
Commit
565383e0
authored
Dec 07, 2020
by
Sebastian Schüpbach
Browse files
normalise root path
Signed-off-by:
Sebastian Schüpbach
<
sebastian.schuepbach@unibas.ch
>
parent
9bd362f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/ch/memobase/FileUtils.scala
View file @
565383e0
...
...
@@ -27,19 +27,22 @@ trait FileUtils {
val
rootPath
:
String
private
val
normalize
:
String
=>
String
=
path
=>
if
(
path
.
endsWith
(
"/"
))
path
.
substring
(
0
,
path
.
length
-
1
)
else
path
val
videoFilePath
:
(
String
,
MimeType
)
=>
String
=
(
id
,
mimeType
)
=>
s
"$rootPath/$id.${getFileTypeExtension(mimeType).get}"
(
id
,
mimeType
)
=>
s
"$
{normalize(
rootPath
)}
/$id.${getFileTypeExtension(mimeType).get}"
val
videoPosterPath
:
String
=>
String
=
id
=>
s
"$rootPath/${id.replace("
/
derived
", "")}-poster.jp2"
id
=>
s
"$
{normalize(
rootPath
)}
/${id.replace("
/
derived
", "")}-poster.jp2"
val
audioFilePath
:
String
=>
String
=
id
=>
s
"$rootPath/$id.mp4"
id
=>
s
"$
{normalize(
rootPath
)}
/$id.mp4"
val
audioSnippetPath
:
String
=>
String
=
id
=>
s
"$rootPath/$id-intro.mp3"
id
=>
s
"$
{normalize(
rootPath
)}
/$id-intro.mp3"
val
imageFilePath
:
String
=>
String
=
id
=>
s
"$rootPath/$id.jp2"
id
=>
s
"$
{normalize(
rootPath
)}
/$id.jp2"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment