Supporting JSON in scenes file. Added Dogfart link finding utility.

This commit is contained in:
DebaucheryLibrarian
2022-04-07 16:06:38 +02:00
parent 21a3bc44e6
commit 1d84830423
6 changed files with 89 additions and 5 deletions

View File

@@ -158,8 +158,8 @@ async function scrapeRelease(baseRelease, entitiesBySlug, type = 'scene') {
// filter out keys with null values to ensure original base value is used instead
const curatedScrapedRelease = Object.entries(scrapedRelease).reduce((acc, [key, value]) => ({
...acc,
...(value !== null && value !== undefined && {
[key]: value,
...(value !== null && value !== undefined && !(Array.isArray(value) && value.filter(Boolean).length === 0) && {
[key]: Array.isArray(value) ? value.filter(Boolean) : value,
}),
}), {});