mirror of
https://github.com/IrosTheBeggar/mStream.git
synced 2025-10-27 07:31:02 +00:00
Fixed bug where certain files were returnign with the wrong slash on windows
This commit is contained in:
parent
9512e12124
commit
f5d1ab9abb
@ -301,9 +301,11 @@ exports.setup = function (mstream, dbSettings){
|
||||
// Format data for API
|
||||
for(var i in rows ){
|
||||
var path = String(rows[i]['cast(path as TEXT)']);
|
||||
var relativePath = fe.relative(req.user.musicDir, path);
|
||||
relativePath = relativePath.replace(/\\/g, '/')
|
||||
|
||||
songs.push({
|
||||
"filepath": slash(fe.relative(req.user.musicDir, path)),
|
||||
"filepath": relativePath,
|
||||
"metadata": {
|
||||
"artist": rows[i].artist,
|
||||
"album": rows[i].album,
|
||||
|
||||
@ -62,7 +62,8 @@ exports.setup = function(mstream, program){
|
||||
}
|
||||
}
|
||||
|
||||
var returnPath = slash( fe.relative(req.user.musicDir, path) );
|
||||
var returnPath = fe.relative(req.user.musicDir, path) ;
|
||||
returnPath = returnPath.replace(/\\/g, '/');
|
||||
if(returnPath.slice(-1) !== '/'){
|
||||
returnPath += '/';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user