fix(route): update douban movie weekly best (#11548)

This commit is contained in:
Jie Zhang 2023-01-04 21:00:39 +08:00 committed by GitHub
parent 0b9ccd763e
commit e455abe486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 4 deletions

View File

@ -1,4 +1,6 @@
const got = require('@/utils/got');
const { art } = require('@/utils/render');
const path = require('path');
module.exports = async (ctx) => {
const type = ctx.params.type || 'movie_weekly_best';
@ -28,17 +30,22 @@ module.exports = async (ctx) => {
link: `https://m.douban.com/subject_collection/${type}`,
description: infoResponse.data.description,
item: data.map(({ title, info, cover, cover_url, url, rating, year, release_date, null_rating_reason, description }) => {
const release = `${year}.${release_date}`;
item: data.map(({ title, cover, cover_url, url, rating, null_rating_reason, description, card_subtitle, photos }) => {
const rate = rating ? `${rating.value.toFixed(1)}` : null_rating_reason;
if (cover && cover.url) {
cover_url = cover.url;
}
description = `标题:${title} <br> 影片信息:${info} <br> 上映日期:${release} <br> 评分:${rate} <br> <img src="${cover_url}"> <p>${description}</p>`;
return {
title,
description,
description: art(path.join(__dirname, '../templates/weekly_best.art'), {
title,
card_subtitle,
description,
rate,
cover_url,
photos,
}),
link: url,
};
}),

View File

@ -0,0 +1,10 @@
<p>标题:{{title}}</p>
<p>评分:{{rate}}</p>
<p>标签:{{card_subtitle}}</p>
<p>影片信息:{{description}}</p>
<p>
<img src="{{cover_url}}" />
{{each photos}}
<img src="{{$value}}" />
{{/each}}
</p>