fix: feed data

This commit is contained in:
Cory Dransfeldt 2024-09-14 21:31:54 -07:00
parent 99283e731a
commit 427a73cd94
No known key found for this signature in database
6 changed files with 17 additions and 18 deletions

View file

@ -89,6 +89,7 @@ export const processContent = (collection) => {
let attribution
let hashTags = tagsToHashtags(item) ? ' ' + tagsToHashtags(item) : ''
if (item['type'] === 'album-release') hashTags = ' #Music #NewMusic'
if (item['type'] === 'concert') hashTags = ' #Music #Concert'
// link attribution if properties exist
if (item?.['authors']?.['mastodon']) {
@ -113,9 +114,9 @@ export const processContent = (collection) => {
// link to artist concerts section if available - artistUrl is only present on concert objects here
if (item?.['artistUrl']) content['url'] = `${item['artistUrl']}?t=${DateTime.fromISO(item['date']).toMillis()}#concerts`
if (item?.['description']) {
content['description'] = `${item['description'].split(' ').slice(0, 25).join(' ')}...`
content['description'] = `${item['description'].split(' ').length >= 25 ? item['description'].split(' ').slice(0, 25).join(' ') + '...' : item['description']}`
} else if (item?.['notes']) {
content['notes'] = `${item['notes'].split(' ').slice(0, 25).join(' ')}...`
content['notes'] = `${item['notes'].split(' ').length >= 25 ? item['description'].split(' ').slice(0, 25).join(' ') + '...' : item['description']}`
} else {
content['description'] = ''
}

View file

@ -71,12 +71,7 @@ export default {
if (rating) processedEntry['rating'] = rating
if (tags) processedEntry['tags'] = tags
if (type === 'album-release') {
if (artist) processedEntry['title'] = `${title} by ${artist}`
processedEntry['excerpt'] = 'Check out the new release!'
processedEntry['content'] = 'Check out the new release!'
}
if (type === 'album-release' && artist) processedEntry['title'] = `${title} by ${artist}`
if (entry) posts.push(processedEntry)
})