Skip to content

Commit

Permalink
fix(core): fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
reruin committed Oct 14, 2021
1 parent d667a83 commit c8ee9e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/sharelist-core/lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ module.exports = (app) => {
if (driver?.get_download_url) {
let { fid, meta } = decode(id)

let { url, max_age } = await driver.get_download_url(fid, meta.key)
let data = await driver.get_download_url(fid, meta.key)

if (url && max_age && driver.cache !== false) {
if (max_age) {
app.cache.set(`${id}#download`, data, max_age)
if (data.url && driver.cache !== false) {
if (data.max_age) {
app.cache.set(`${id}#download`, data, data.max_age)
}
}

return url
return data
}
}

Expand Down Expand Up @@ -196,7 +196,7 @@ module.exports = (app) => {
const get = async ({ paths = [], id }) => {
let data

if (!id && path) {
if (!id && paths) {
data = await getByPath(paths)
id = data.id
}
Expand Down

0 comments on commit c8ee9e6

Please sign in to comment.