Added parent-child relations to network, showing parent network in sidebar. Added Burning Angel using Gamma API.

This commit is contained in:
2020-02-20 02:35:23 +01:00
parent 6b358d74db
commit 377970f874
30 changed files with 3174 additions and 913 deletions

View File

@@ -43,7 +43,7 @@ async function createThumbnail(buffer) {
function pluckItems(items, specifiedLimit) {
const limit = specifiedLimit || config.media.limit;
if (items.length <= limit) return items;
if (!items || items.length <= limit) return items;
const plucked = [1]
.concat(
@@ -73,7 +73,9 @@ async function getEntropy(buffer) {
}
async function extractItem(source) {
const res = await bhttp.get(source.src);
const res = await bhttp.get(source.src, {
responseTimeout: 10000,
});
if (res.statusCode === 200) {
const { q } = ex(res.body.toString());
@@ -114,7 +116,9 @@ async function fetchItem(source, index, existingItemsBySource, domain, role, att
logger.verbose(`Fetching media item from ${source.src || source}`);
const res = await bhttp.get(source.src || source);
const res = await bhttp.get(source.src || source, {
responseTimeout: 10000,
});
if (res.statusCode === 200) {
const { pathname } = new URL(source.src || source);
@@ -199,6 +203,8 @@ async function saveItems(items, domain, role) {
logger.error(`Failed to store ${domain} ${role} from ${item.source}: ${error.message}`);
return null;
}
}, {
concurrency: 20,
});
}