Skip to content
This repository was archived by the owner on Jun 14, 2021. It is now read-only.

Commit 38d37cc

Browse files
author
XiaoLin
committed
fix: duplicate image proxy
1 parent 5f7e5c1 commit 38d37cc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/module/metadata.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ class Metadata {
355355
updateTime: (new Date()).getTime()
356356
}
357357

358-
if (photoURL) data.photoURL = file.getProxyPrefix() + photoURL
358+
if (photoURL) data.photoURL = photoURL
359359

360360
let id = await db(`${type}`).insert(data).transacting(trx).select('id')
361361
id = id[0]
@@ -417,14 +417,14 @@ class Metadata {
417417
async getMetaInfoByMetaId (type, id) {
418418
const result = await cache(`getMeta_${type}_${id}`, async () => {
419419
const res = await db(type).where('id', id).select('*').first()
420-
return res
421-
})
422420

423-
if (!result) return null
421+
if (!res) return null
422+
if (res.photoURL) res.photoURL = file.getProxyPrefix() + res.photoURL
424423

425-
if (result.photoURL) result.photoURL = file.getProxyPrefix() + result.photoURL
424+
return Object.assign({}, res)
425+
})
426426

427-
return Object.assign({}, result)
427+
return result
428428
}
429429

430430
/**

0 commit comments

Comments
 (0)