Added post score to index and variables.
This commit is contained in:
parent
12268fcb05
commit
60973a0e70
|
@ -61,6 +61,7 @@ function curatePost(acc, post, user, index, indexed, ignoreIds, processed, args)
|
||||||
url: post.url,
|
url: post.url,
|
||||||
datetime: new Date(post.created_utc * 1000),
|
datetime: new Date(post.created_utc * 1000),
|
||||||
subreddit: post.subreddit.display_name,
|
subreddit: post.subreddit.display_name,
|
||||||
|
score: post.score,
|
||||||
preview: post.preview ? post.preview.images.map(image => image.source) : null,
|
preview: post.preview ? post.preview.images.map(image => image.source) : null,
|
||||||
host,
|
host,
|
||||||
hash: hashPost(post),
|
hash: hashPost(post),
|
||||||
|
|
|
@ -41,6 +41,7 @@ function interpolate(pattern, user, post, item, strip = true, dateFormat = confi
|
||||||
$postIndex: post.index + config.library.indexOffset,
|
$postIndex: post.index + config.library.indexOffset,
|
||||||
$postHash: post.hash,
|
$postHash: post.hash,
|
||||||
$url: post.url,
|
$url: post.url,
|
||||||
|
$score: post.score,
|
||||||
$subreddit: post.subreddit,
|
$subreddit: post.subreddit,
|
||||||
$hostLabel: post.host.label,
|
$hostLabel: post.host.label,
|
||||||
$hostId: post.host.id,
|
$hostId: post.host.id,
|
||||||
|
|
|
@ -20,6 +20,7 @@ async function writeToIndex(posts, profilePaths, user, args) {
|
||||||
hostId: post.host.id,
|
hostId: post.host.id,
|
||||||
date: post.datetime,
|
date: post.datetime,
|
||||||
indexed: now,
|
indexed: now,
|
||||||
|
score: post.score,
|
||||||
title: post.title,
|
title: post.title,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ async function writeToIndex(posts, profilePaths, user, args) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!data.profile.image && !data.profile.description && !data.posts.length) {
|
if (!data.profile.image && !data.profile.description && !data.posts.length) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return save(filepath, textToStream(yaml.safeDump(data)));
|
return save(filepath, textToStream(yaml.safeDump(data)));
|
||||||
|
|
Loading…
Reference in New Issue