fix(route): 内蒙古广播电视台点播enclosure_type缺失 (#11360)

This commit is contained in:
Ethan Shen
2022-12-01 00:39:37 +08:00
committed by GitHub
parent 5d59219bf6
commit 8fd98af6a7
+20 -14
View File
@@ -19,20 +19,26 @@ module.exports = async (ctx) => {
const data = response.data;
const items = data.map((item) => ({
title: item.title,
link: item.content_url,
author: item.column_name,
pubDate: timezone(parseDate(item.publish_time), +8),
description: art(path.join(__dirname, 'templates/description.art'), {
type: item.type,
image: item.index_pic,
file: `${hostUrl}/${item.target_path}${item.target_filename}`,
}),
enclosure_url: `${hostUrl}/${item.target_path}${item.target_filename}`,
itunes_duration: item.video.duration,
itunes_item_image: item.index_pic,
}));
const items = data.map((item) => {
const enclosure_url = `${hostUrl}/${item.target_path}${item.target_filename}`;
const enclosure_type = `${item.type}/${enclosure_url.match(/\.(\w+)$/)[1]}`;
return {
title: item.title,
link: item.content_url,
author: item.column_name,
pubDate: timezone(parseDate(item.publish_time), +8),
description: art(path.join(__dirname, 'templates/description.art'), {
type: item.type,
image: item.index_pic,
file: enclosure_url,
}),
enclosure_url,
enclosure_type,
itunes_duration: item.video.duration,
itunes_item_image: item.index_pic,
};
});
const author = data[0].column_name;
const imageUrl = data[0].column_info.indexpic;