Compare commits
2 Commits
06fa428790
...
5afd86a932
Author | SHA1 | Date |
---|---|---|
|
5afd86a932 | |
|
74274f879e |
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.99.0",
|
"version": "1.99.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.99.0",
|
"version": "1.99.1",
|
||||||
"description": "All the latest porn releases in one place",
|
"description": "All the latest porn releases in one place",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -231,7 +231,7 @@ function groupItems(items) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function storeMedia(sources, domain, role) {
|
async function storeMedia(sources, domain, role, { entropyFilter = 2.5 } = {}) {
|
||||||
const presentSources = sources.filter(Boolean);
|
const presentSources = sources.filter(Boolean);
|
||||||
|
|
||||||
if (presentSources.length === 0) {
|
if (presentSources.length === 0) {
|
||||||
|
@ -250,7 +250,7 @@ async function storeMedia(sources, domain, role) {
|
||||||
const { hash: fetchedItemsByHash } = groupItems(fetchedItems);
|
const { hash: fetchedItemsByHash } = groupItems(fetchedItems);
|
||||||
|
|
||||||
// find hash duplicates that don't need to be re-saved
|
// find hash duplicates that don't need to be re-saved
|
||||||
const uniqueFetchedItems = Object.values(fetchedItemsByHash);
|
const uniqueFetchedItems = Object.values(fetchedItemsByHash).filter(item => !entropyFilter || item.entropy >= entropyFilter);
|
||||||
const existingHashItems = await knex('media').whereIn('hash', uniqueFetchedItems.map(item => item.hash));
|
const existingHashItems = await knex('media').whereIn('hash', uniqueFetchedItems.map(item => item.hash));
|
||||||
const { hash: existingHashItemsByHash } = groupItems(existingHashItems);
|
const { hash: existingHashItemsByHash } = groupItems(existingHashItems);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue