This commit is contained in:
tree 2023-03-13 17:42:38 +01:00
parent 95b80e485a
commit cc1c2abfa9
2 changed files with 8 additions and 3 deletions

View File

@ -14,6 +14,9 @@
const sg = segments[i]
if (sg.remote) {
const event = bundle.events.find(e => e.id === sg.remote)
if (!event || !event.segments) {
continue
}
const remoteSegments = event.segments.map(rs => Object.assign(rs, {
event,
remote: true

View File

@ -38,14 +38,16 @@
}
function enrichItem (it) {
if (!it) return null
console.log(it)
if (!it || !it.segments) return it
// segments
let segments = it.segments
for (let i = 0; i < segments.length; i++) {
const sg = segments[i]
if (sg.remote) {
const event = data.bundle.events.find(e => e.id === sg.remote)
if (!event || !event.segments) {
continue
}
const remoteSegments = event.segments.map(rs => Object.assign(rs, {
event,
remote: true
@ -71,7 +73,7 @@
.join(', ')
}
$: itemDescription = `${formatItemDate(item, { full: true })} @ ${item.venues ? venuesMap(item.venues) : item.venueName }. ${item.tags ? item.tags.join(', ') : ''}`
$: itemDescription = col === 'event' ? `${formatItemDate(item, { full: true })} @ ${item.venues ? venuesMap(item.venues) : item.venueName }. ${item.tags ? item.tags.join(', ') : ''}` : null
</script>
<svelte:head>