feat(route): no longer publish date available (#17475)

This commit is contained in:
cubroe
2024-11-06 23:03:23 +08:00
committed by GitHub
parent 2e4b8105ad
commit 9f77cb9348
-10
View File
@@ -8,7 +8,6 @@ import path from 'node:path';
import got from '@/utils/got';
import { art } from '@/utils/render';
import { parseDate } from '@/utils/parse-date';
const baseURL = 'https://freecomputerbooks.com/';
@@ -89,15 +88,6 @@ function buildPostItem(listItem, categoryTitle, cache) {
: categoryTitle,
};
const pubDateText = postInfo.find('span:last').text().replace(/^on /, '');
if (pubDateText) {
// Pretty much the same situation: Only a "Selected New Books" page has
// explicit publication dates for posts; even on each post's details
// page, there seems to be only the publication date for the book, but
// the post's creation date is still missing.
postItem.pubDate = parseDate(pubDateText);
}
return cache.tryGet(postItem.link, () => insertDescriptionInto(postItem));
}