Added support for fetching content directly from host. Improved pattern interpolation. Refactored content modules.
This commit is contained in:
@@ -25,10 +25,17 @@ async function saveProfileImage(user, args) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const filepath = interpolate(config.library.profile.image, user, null, {
|
||||
const filepath = interpolate(
|
||||
config.library.profile.image,
|
||||
{
|
||||
// pass profile image as item to interpolate extension variable
|
||||
url: image,
|
||||
});
|
||||
url: image,
|
||||
},
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
user,
|
||||
);
|
||||
|
||||
try {
|
||||
const stream = await fetchItem(image, 0, { permalink: `https://reddit.com/user/${user.name}` });
|
||||
@@ -54,7 +61,7 @@ async function saveProfileDescription(user, args) {
|
||||
|
||||
if (config.library.profile.description && !user.fallback && !user.deleted) {
|
||||
if (user.profile && user.profile.description) {
|
||||
const filepath = interpolate(config.library.profile.description, user);
|
||||
const filepath = interpolate(config.library.profile.description, null, null, null, null, user);
|
||||
const stream = textToStream(user.profile.description);
|
||||
|
||||
try {
|
||||
|
||||
@@ -8,7 +8,7 @@ const textToStream = require('./textToStream');
|
||||
const save = require('./save');
|
||||
|
||||
async function writeToIndex(posts, profilePaths, user, args) {
|
||||
const filepath = interpolate(config.library.index.file, user, null, false);
|
||||
const filepath = interpolate(config.library.index.file, null, null, null, null, user, false);
|
||||
const now = new Date();
|
||||
|
||||
const newAndUpdatedEntries = posts.concat(user.indexed.updated, args.indexIgnored ? user.indexed.ignored : []).map((post) => {
|
||||
|
||||
Reference in New Issue
Block a user