No longer redownload profile image and description when indexed, unless --redownload-profile is specified.
This commit is contained in:
@@ -6,7 +6,7 @@ const yaml = require('js-yaml');
|
||||
|
||||
const interpolate = require('../interpolate.js');
|
||||
|
||||
async function getIndexedPosts(user) {
|
||||
async function getIndex(user) {
|
||||
const indexFilePath = interpolate(config.library.index.file, user, null, null, false);
|
||||
|
||||
try {
|
||||
@@ -20,4 +20,4 @@ async function getIndexedPosts(user) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = getIndexedPosts;
|
||||
module.exports = getIndex;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
const Promise = require('bluebird');
|
||||
|
||||
const getIndexedPosts = require('./getIndexedPosts.js');
|
||||
const getIndex = require('./getIndex.js');
|
||||
const curateUser = require('../curate/user.js');
|
||||
|
||||
const getUser = async (username, reddit) => {
|
||||
@@ -38,9 +38,9 @@ const getPostsWrap = reddit => function getPosts(postIds, userPosts = {}) {
|
||||
}
|
||||
|
||||
const user = await getUser(post.author.name, reddit);
|
||||
const indexed = await getIndexedPosts(user);
|
||||
const { profile, posts: indexed } = await getIndexedPosts(user);
|
||||
|
||||
return { ...accUserPosts, [post.author.name]: { ...user, posts: [post], indexed: { original: indexed, updated: [] } } };
|
||||
return { ...accUserPosts, [post.author.name]: { ...user, posts: [post], indexed: { profile, original: indexed, updated: [] } } };
|
||||
}), userPosts);
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ const Promise = require('bluebird');
|
||||
const fs = require('fs-extra');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const getIndexedPosts = require('./getIndexedPosts.js');
|
||||
const getIndex = require('./getIndex.js');
|
||||
const getArchivePostIds = require('../archives/getArchivePostIds.js');
|
||||
const curateUser = require('../curate/user.js');
|
||||
const interpolate = require('../interpolate.js');
|
||||
@@ -54,14 +54,14 @@ function getUserPostsWrap(reddit, args) {
|
||||
getPosts(username, reddit, args),
|
||||
]);
|
||||
|
||||
const { posts: indexed } = await getIndexedPosts(user);
|
||||
const { profile, posts: indexed } = await getIndex(user);
|
||||
|
||||
if (args.archives) {
|
||||
posts.push(...await getArchivedPosts(username, posts, reddit));
|
||||
}
|
||||
|
||||
if (posts.length) {
|
||||
return { ...user, posts, indexed: { original: indexed, updated: [] } };
|
||||
return { ...user, posts, indexed: { profile, original: indexed, updated: [] } };
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user