Fix scraped studio not matching existing value (#4548)

* Fix scraped studio not matching existing
* Fix incorrect key value
This commit is contained in:
WithoutPants
2024-02-13 12:24:11 +11:00
committed by GitHub
parent e9703e9a6e
commit dad4ab6a6f
6 changed files with 36 additions and 16 deletions

View File

@@ -106,6 +106,23 @@ export class ObjectListScrapeResult<
}
}
export class ObjectScrapeResult<
T extends IHasStoredID
> extends ScrapeResult<T> {
public constructor(
originalValue?: T | null,
newValue?: T | null,
useNewValue?: boolean
) {
super(
originalValue,
newValue,
useNewValue,
(o1, o2) => o1?.stored_id === o2?.stored_id
);
}
}
export function hasScrapedValues(values: { scraped: boolean }[]): boolean {
return values.some((r) => r.scraped);
}