|
|
@@ -732,33 +732,6 @@ router.get('/play/:id', function (req, res, next) {
|
|
|
|
|
|
});
|
|
|
|
|
|
-// print页路由
|
|
|
-router.get('/print/:id', function (req, res, next) {
|
|
|
- (async function () {
|
|
|
- let id = req.params.id;
|
|
|
- let data = {
|
|
|
- id,
|
|
|
- title: meta.playTitle.en,
|
|
|
- description: meta.playDescription.en,
|
|
|
- };
|
|
|
-
|
|
|
- utils.validators.validateId(id);
|
|
|
- let doc = await models.Art.findById(id);
|
|
|
- if (!doc) throw createError(404, 'Art Not Found!');
|
|
|
-
|
|
|
- let host = config.cdnHost ?? config.resHost;
|
|
|
- let size = Math.min(doc.width, 2000);
|
|
|
- let downlink = `${host}/thumbs/coloring-page/page/${size}/${doc._id}.jpeg`;
|
|
|
-
|
|
|
- data.downlink = doc;
|
|
|
-
|
|
|
- res.render('print', data);
|
|
|
-
|
|
|
- })().catch(next);
|
|
|
-
|
|
|
-});
|
|
|
-
|
|
|
-
|
|
|
|
|
|
router.get('/:lang/info', function (req, res, next) {
|
|
|
(async function () {
|
|
|
@@ -785,20 +758,6 @@ const organizeData = (data, lang) => {
|
|
|
let version = publishVersion + 1500;
|
|
|
|
|
|
doc.thumb = `${host}/thumbs/coloring-page/page/480/${doc._id}.jpeg`;
|
|
|
- if (doc.mystery) { // 神秘图固定用一张
|
|
|
- doc.thumb = `${host}/thumbs/coloring-page/mystery/480/${doc._id}.jpeg`;
|
|
|
- } else if (doc.hasSpecial) { // special图有切线图、渐变切线图、灰度图、上传图3中可选
|
|
|
- let str = 'special_outline';
|
|
|
- if (doc.useSpecialThumb == 1) {
|
|
|
- str = 'special_gray';
|
|
|
- } else if (doc.useSpecialThumb == 2) {
|
|
|
- str = 'special_thumb';
|
|
|
- } else if (doc.useSpecialThumb == 3) {
|
|
|
- str = 'special_gradient';
|
|
|
- }
|
|
|
- doc.thumb = `${host}/thumbs/coloring-page/${str}/480/${doc._id}.jpeg`;
|
|
|
- }
|
|
|
-
|
|
|
doc.zip = `${host}/zips/v2/number_mini/${version}/${doc._id}.zip`;
|
|
|
|
|
|
if (doc.title) {
|
|
|
@@ -830,20 +789,6 @@ const organizeDetail = (doc, lang) => {
|
|
|
let version = publishVersion + 1500;
|
|
|
|
|
|
doc.thumb = `${host}/thumbs/coloring-page/page/480/${doc._id}.jpeg`;
|
|
|
- if (doc.mystery) { // 神秘图固定用一张
|
|
|
- doc.thumb = `${host}/thumbs/coloring-page/mystery/480/${doc._id}.jpeg`;
|
|
|
- } else if (doc.hasSpecial) { // special图有切线图、渐变切线图、灰度图、上传图3中可选
|
|
|
- let str = 'special_outline';
|
|
|
- if (doc.useSpecialThumb == 1) {
|
|
|
- str = 'special_gray';
|
|
|
- } else if (doc.useSpecialThumb == 2) {
|
|
|
- str = 'special_thumb';
|
|
|
- } else if (doc.useSpecialThumb == 3) {
|
|
|
- str = 'special_gradient';
|
|
|
- }
|
|
|
- doc.thumb = `${host}/thumbs/coloring-page/${str}/480/${doc._id}.jpeg`;
|
|
|
- }
|
|
|
-
|
|
|
doc.zip = `${host}/zips/v2/number_mini/${version}/${doc._id}.zip`
|
|
|
|
|
|
// doc.title = translate.titleTest[lang];
|
|
|
@@ -871,8 +816,7 @@ const organizeDetail = (doc, lang) => {
|
|
|
let utf8name = encodeURIComponent(doc.title.replace(/[\s_]+/g, '-')).toLowerCase();
|
|
|
doc.uri = `/${lang}/coloring-page/${utf8name}-${doc._id}`;
|
|
|
|
|
|
- let size = Math.min(doc.width, 2000);
|
|
|
- doc.downlink = `${host}/thumbs/coloring-page/page/${size}/${doc._id}.jpeg`;
|
|
|
+ doc.downlink = `${host}/thumbs/coloring-page/page/1200/${doc._id}.jpeg`;
|
|
|
|
|
|
delete doc.hasSpecial;
|
|
|
delete doc.useSpecialThumb;
|