more efficient logic for the background script
This commit is contained in:
parent
252d41886a
commit
a57c3114d8
|
@ -85,11 +85,11 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
|
||||||
image:
|
image:
|
||||||
user.archiveAsScreenshot && !link.image?.startsWith("archive")
|
user.archiveAsScreenshot && !link.image?.startsWith("archive")
|
||||||
? "pending"
|
? "pending"
|
||||||
: undefined,
|
: "unavailable",
|
||||||
pdf:
|
pdf:
|
||||||
user.archiveAsPDF && !link.pdf?.startsWith("archive")
|
user.archiveAsPDF && !link.pdf?.startsWith("archive")
|
||||||
? "pending"
|
? "pending"
|
||||||
: undefined,
|
: "unavailable",
|
||||||
readable: !link.readable?.startsWith("archive")
|
readable: !link.readable?.startsWith("archive")
|
||||||
? "pending"
|
? "pending"
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|
|
@ -19,36 +19,16 @@ async function processBatch() {
|
||||||
url: { not: null },
|
url: { not: null },
|
||||||
OR: [
|
OR: [
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsScreenshot: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
image: null,
|
image: null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsScreenshot: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
image: "pending",
|
image: "pending",
|
||||||
},
|
},
|
||||||
///////////////////////
|
///////////////////////
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsPDF: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
pdf: null,
|
pdf: null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsPDF: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
pdf: "pending",
|
pdf: "pending",
|
||||||
},
|
},
|
||||||
///////////////////////
|
///////////////////////
|
||||||
|
@ -76,36 +56,16 @@ async function processBatch() {
|
||||||
url: { not: null },
|
url: { not: null },
|
||||||
OR: [
|
OR: [
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsScreenshot: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
image: null,
|
image: null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsScreenshot: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
image: "pending",
|
image: "pending",
|
||||||
},
|
},
|
||||||
///////////////////////
|
///////////////////////
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsPDF: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
pdf: null,
|
pdf: null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
collection: {
|
|
||||||
owner: {
|
|
||||||
archiveAsPDF: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
pdf: "pending",
|
pdf: "pending",
|
||||||
},
|
},
|
||||||
///////////////////////
|
///////////////////////
|
||||||
|
@ -115,13 +75,6 @@ async function processBatch() {
|
||||||
{
|
{
|
||||||
readable: "pending",
|
readable: "pending",
|
||||||
},
|
},
|
||||||
///////////////////////
|
|
||||||
{
|
|
||||||
preview: null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
preview: "pending",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
take: archiveTakeCount,
|
take: archiveTakeCount,
|
||||||
|
|
Ŝarĝante…
Reference in New Issue