Skip to content

Commit

Permalink
Merge pull request #606 from DIYgod/master
Browse files Browse the repository at this point in the history
[pull] master from diygod:master
  • Loading branch information
pull[bot] authored Dec 1, 2022
2 parents 64a2eab + 8fd98af commit d525feb
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions lib/v2/nmtv/column.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

1 comment on commit d525feb

@vercel
Copy link

@vercel vercel bot commented on d525feb Dec 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.