Skip to content

Commit

Permalink
Add convertVFSURL helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
nomad2k committed Dec 8, 2014
1 parent b261c6e commit 815b771
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions resources/js/app/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 815b771

Please sign in to comment.