mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fix:Static router for downloading single file library items #627
This commit is contained in:
parent
0ad7a98fc7
commit
6cfe583535
@ -17,7 +17,9 @@ class StaticRouter {
|
|||||||
if (!item) return res.status(404).send('Item not found with id ' + req.params.id)
|
if (!item) return res.status(404).send('Item not found with id ' + req.params.id)
|
||||||
|
|
||||||
var remainingPath = req.params['0']
|
var remainingPath = req.params['0']
|
||||||
var fullPath = Path.join(item.path, remainingPath)
|
var fullPath = null
|
||||||
|
if (item.isFile) fullPath = item.path
|
||||||
|
else fullPath = Path.join(item.path, remainingPath)
|
||||||
res.sendFile(fullPath)
|
res.sendFile(fullPath)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user