feat: add a default pubDate

close #5812
This commit is contained in:
Henry
2020-10-09 21:54:26 +01:00
parent ede67825b0
commit 19a219e076
+4
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);