more efficient logic for the background script

This commit is contained in:
daniel31x13 2024-03-05 18:28:11 -05:00
parent 252d41886a
commit a57c3114d8
2 changed files with 2 additions and 49 deletions

View File

@ -85,11 +85,11 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
image:
user.archiveAsScreenshot && !link.image?.startsWith("archive")
? "pending"
: undefined,
: "unavailable",
pdf:
user.archiveAsPDF && !link.pdf?.startsWith("archive")
? "pending"
: undefined,
: "unavailable",
readable: !link.readable?.startsWith("archive")
? "pending"
: undefined,

View File

@ -19,36 +19,16 @@ async function processBatch() {
url: { not: null },
OR: [
{
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: null,
},
{
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: "pending",
},
///////////////////////
{
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: null,
},
{
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: "pending",
},
///////////////////////
@ -76,36 +56,16 @@ async function processBatch() {
url: { not: null },
OR: [
{
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: null,
},
{
collection: {
owner: {
archiveAsScreenshot: true,
},
},
image: "pending",
},
///////////////////////
{
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: null,
},
{
collection: {
owner: {
archiveAsPDF: true,
},
},
pdf: "pending",
},
///////////////////////
@ -115,13 +75,6 @@ async function processBatch() {
{
readable: "pending",
},
///////////////////////
{
preview: null,
},
{
preview: "pending",
},
],
},
take: archiveTakeCount,