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