feat: add a default pubDate

close #5812
This commit is contained in:
Henry 2020-10-09 21:53:53 +01:00
parent ede67825b0
commit 19a219e076
No known key found for this signature in database
GPG Key ID: 5B3C7E38D81D924D
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ module.exports = async (ctx, next) => {
}
}
if (!item.pubDate) {
item.pubDate = new Date().toISOString();
}
if (item.enclosure_length) {
const itunes_duration =
Math.floor(item.enclosure_length / 3600) + ':' + (Math.floor((item.enclosure_length % 3600) / 60) / 100).toFixed(2).slice(-2) + ':' + (((item.enclosure_length % 3600) % 60) / 100).toFixed(2).slice(-2);