chore: album releases cleanup
This commit is contained in:
parent
6f07c6aa4d
commit
4a68d4d64a
1 changed files with 17 additions and 21 deletions
|
@ -5,7 +5,6 @@ import { DateTime } from 'luxon'
|
||||||
export default async function () {
|
export default async function () {
|
||||||
const URL = process.env.SECRET_FEED_ALBUM_RELEASES
|
const URL = process.env.SECRET_FEED_ALBUM_RELEASES
|
||||||
const icsToJson = ics.default
|
const icsToJson = ics.default
|
||||||
if (process.env.ELEVENTY_PRODUCTION) {
|
|
||||||
const asset = new AssetCache('album_release_data')
|
const asset = new AssetCache('album_release_data')
|
||||||
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
|
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
|
||||||
const icsRes = await fetch(URL)
|
const icsRes = await fetch(URL)
|
||||||
|
@ -23,7 +22,4 @@ export default async function () {
|
||||||
})
|
})
|
||||||
await asset.save(albumReleases, 'json')
|
await asset.save(albumReleases, 'json')
|
||||||
return albumReleases
|
return albumReleases
|
||||||
} else {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue