From 815b771a915975846d5d144727a3ba1703f2b98e Mon Sep 17 00:00:00 2001 From: Andrew Fyfe Date: Mon, 8 Dec 2014 11:49:36 +0000 Subject: [PATCH] Add convertVFSURL helper function --- resources/js/app/common/util.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/resources/js/app/common/util.js b/resources/js/app/common/util.js index 8569a3c..71ad4f6 100644 --- a/resources/js/app/common/util.js +++ b/resources/js/app/common/util.js @@ -84,6 +84,20 @@ XWMM.util.convertArtworkURL = function(value) { } }; +/** + * Converts a file path to a VFS url + * @param {string} value The file path to convert. + * @return {string} The converted url. + */ +XWMM.util.convertVFSURL = function(value) { + if (value === undefined || value === '') { + return ''; + } + else { + return '/vfs/' + encodeURI(value); + } +}; + /** * Convert a rating to 1 decimal place * @param {string} value The rating to convert.