chore: perf improvements
This commit is contained in:
parent
bb9a086c32
commit
de5cb2db8b
4 changed files with 21 additions and 6 deletions
|
@ -12,7 +12,9 @@
|
|||
"listenbrainz": "https://listenbrainz.org/user/cdransf/",
|
||||
"pinboard": "https://pinboard.in/u:cdme/profile/public/",
|
||||
"letterboxd": "https://letterboxd.com/cdme",
|
||||
"letterboxd-host": "https://a.ltrbxd.com",
|
||||
"trakt": "https://trakt.tv/users/cdransf",
|
||||
"oku": "https://oku.club/user/cory",
|
||||
"coffee": "https://www.buymeacoffee.com/cory"
|
||||
"coffee": "https://www.buymeacoffee.com/cory",
|
||||
"cdn-movies": "https://movies.coryd.dev"
|
||||
}
|
||||
|
|
|
@ -7,10 +7,17 @@ module.exports = async function () {
|
|||
// noinspection JSCheckFunctionSignatures
|
||||
const asset = new AssetCache('tv_data')
|
||||
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
|
||||
const res = await extract(url).catch((error) => {
|
||||
const res = await extract(url, {
|
||||
getExtraEntryFields: (feedEntry) => {
|
||||
const image = feedEntry['media:thumbnail']['@_url']
|
||||
return {
|
||||
image,
|
||||
}
|
||||
},
|
||||
}).catch((error) => {
|
||||
console.log(error.message)
|
||||
})
|
||||
const data = res.entries.splice(0, 5)
|
||||
const data = res.entries.splice(0, 6)
|
||||
await asset.save(data, 'json')
|
||||
return data
|
||||
}
|
||||
|
|
Reference in a new issue