Added date fallback configuration to summary templates, disabled by default.
This commit is contained in:
parent
a8ceb41f02
commit
8e9af7d6c4
|
@ -12,3 +12,4 @@
|
||||||
genders: fmtou
|
genders: fmtou
|
||||||
- key: date
|
- key: date
|
||||||
format: yyyy-MM-dd
|
format: yyyy-MM-dd
|
||||||
|
fallbackToAdded: false
|
||||||
|
|
|
@ -40,7 +40,19 @@ const propProcessors = {
|
||||||
})
|
})
|
||||||
.map((tag) => tag.name),
|
.map((tag) => tag.name),
|
||||||
movie: (sceneInfo) => sceneInfo.movies?.[0]?.title,
|
movie: (sceneInfo) => sceneInfo.movies?.[0]?.title,
|
||||||
date: (sceneInfo, options) => (sceneInfo.effectiveDate ? format(sceneInfo.effectiveDate, options.format || 'yyyy-MM-dd') : ''),
|
date: (sceneInfo, options) => {
|
||||||
|
const dateFormat = options.format || 'yyyy-MM-dd';
|
||||||
|
|
||||||
|
if (sceneInfo.date) {
|
||||||
|
return format(sceneInfo.date, dateFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.fallbackToAdded && sceneInfo.effectiveDate) {
|
||||||
|
return format(sceneInfo.effectiveDate, dateFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function curateValue(value, item) {
|
function curateValue(value, item) {
|
||||||
|
|
Loading…
Reference in New Issue