summaryrefslogtreecommitdiff
path: root/client/vendor/paths.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-21 04:48:52 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-21 04:48:52 +0200
commitd41070c7b00fafc974a1a6e7b6d1b42391fa57ed (patch)
tree4178eba89627e8581cdc5eea65bf7f11591f6b45 /client/vendor/paths.js
parentd02cbad01f3abfa8a1aad0b55b8bd9cf544090cf (diff)
all async paths working
Diffstat (limited to 'client/vendor/paths.js')
-rw-r--r--client/vendor/paths.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/client/vendor/paths.js b/client/vendor/paths.js
new file mode 100644
index 0000000..14c35b1
--- /dev/null
+++ b/client/vendor/paths.js
@@ -0,0 +1,18 @@
+function filepath (file) {
+ return '/data/' + file.folder_id + '/' + encodeURIComponent(file.name)
+}
+function mp3path (file) {
+ if (file.mime !== 'audio/mp3') {
+ return filepath(file) + '.mp3'
+ }
+ return filepath(file)
+}
+function pngpath (file) {
+ return filepath(file) + '.png'
+}
+
+export {
+ filepath,
+ mp3path,
+ pngpath,
+} \ No newline at end of file