Filtering falsey values from summary template to prevent empty wraps.

This commit is contained in:
2025-03-20 02:39:26 +01:00
parent e8f36ad9e4
commit 8f9baf6bc5
2 changed files with 3 additions and 2 deletions

View File

@@ -51,12 +51,13 @@ const propProcessors = {
return format(sceneInfo.effectiveDate, dateFormat);
}
return '';
return null;
},
};
function curateValue(value, item) {
return [].concat(value) // account for both arrays (actors, tags) and strings (title, channel)
.filter((listValue) => !!listValue)
.slice(0, item.limit || Infinity)
.map((listValue) => (item.slugify ? slugify(listValue, item.slugify) : listValue))
.map((listValue) => ellipsis(listValue, item.slice || Infinity, item.ellipsis || ''))