forked from DebaucheryLibrarian/traxxx
Added tags and duration to scraping. Added LegalPorno scraper.
This commit is contained in:
@@ -7,10 +7,6 @@ const formatters = {
|
||||
date: (date, column) => moment(date).format(column.format || 'MMM DD, YYYY'),
|
||||
actors: actors => actors.join(', '),
|
||||
rating: (rating) => {
|
||||
if (rating === null) {
|
||||
return '\x1b[90mNot available\x1b[0m';
|
||||
}
|
||||
|
||||
if ((rating.likes === 0 && rating.dislikes === 0) || rating.stars === 0) {
|
||||
return '\x1b[90mUnrated\x1b[0m';
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ function renderReleases(scenes, screen) {
|
||||
const isFuture = moment(scene.date).isAfter();
|
||||
|
||||
const row = config.columns.reduce((acc, column) => {
|
||||
const value = (formatters[column.value]
|
||||
const value = (scene[column.value] && (formatters[column.value]
|
||||
? formatters[column.value](scene[column.value], column)
|
||||
: scene[column.value])
|
||||
.toString();
|
||||
.toString()) || '\x1b[90mNot available\x1b[0m';
|
||||
|
||||
const realLength = value.replace(/\x1b\[\d+m/g, '').length; // eslint-disable-line no-control-regex
|
||||
const entityLength = value.length - realLength;
|
||||
|
||||
Reference in New Issue
Block a user