chore: filter to query

This commit is contained in:
Cory Dransfeldt 2024-10-13 15:10:37 -07:00
parent eec1caa321
commit ed65bb8127
No known key found for this signature in database
5 changed files with 8 additions and 13 deletions

View file

@ -49,6 +49,5 @@ export default {
}
return `${allButLast} and ${last}`
},
formatVenue: (venue) => venue.split(',')[0].trim()
}
}

View file

@ -78,9 +78,9 @@ schema: artist
{%- capture venue -%}
{% if concert.venue_name %}
{% if concert.venue_latitude and concert.venue_longitude %}
<a href="https://www.openstreetmap.org/?mlat={{ concert.venue_latitude }}&mlon={{ concert.venue_longitude }}#map=18/{{ concert.venue_latitude }}/{{ concert.venue_longitude }}">{{ concert.venue_name | formatVenue }}</a>
<a href="https://www.openstreetmap.org/?mlat={{ concert.venue_latitude }}&mlon={{ concert.venue_longitude }}#map=18/{{ concert.venue_latitude }}/{{ concert.venue_longitude }}">{{ concert.venue_name_short }}</a>
{% else %}
{{ concert.venue_name | formatVenue }}
{{ concert.venue_name_short }}
{% endif %}
{% endif %}
{%- endcapture -%}

View file

@ -24,9 +24,9 @@ permalink: "/music/concerts/{% if pagination.pageNumber > 0 %}{{ pagination.page
{%- capture venue -%}
{% if concert.venue.name %}
{% if concert.venue.latitude and concert.venue.longitude %}
<a href="https://www.openstreetmap.org/?mlat={{ concert.venue.latitude }}&mlon={{ concert.venue.longitude }}#map=18/{{ concert.venue.latitude }}/{{ concert.venue.longitude }}">{{ concert.venue.name | formatVenue }}</a>
<a href="https://www.openstreetmap.org/?mlat={{ concert.venue.latitude }}&mlon={{ concert.venue.longitude }}#map=18/{{ concert.venue.latitude }}/{{ concert.venue.longitude }}">{{ concert.venue.name_short }}</a>
{% else %}
{{ concert.venue.name | formatVenue }}
{{ concert.venue.name_short }}
{% endif %}
{% endif %}
{%- endcapture -%}

View file

@ -41,6 +41,7 @@ SELECT
'id', c.id,
'date', c.date,
'venue_name', v.name,
'venue_name_short', trim(split_part(v.name, ',', 1)),
'venue_latitude', v.latitude,
'venue_longitude', v.longitude,
'notes', c.notes
@ -65,9 +66,7 @@ SELECT
SELECT json_agg(json_build_object(
'title', m.title,
'year', m.year,
'url', m.slug,
'rating', m.rating,
'favorite', m.favorite
'url', m.slug
) ORDER BY m.year DESC)
FROM movies_artists ma
LEFT JOIN movies m ON ma.movies_id = m.id

View file

@ -3,10 +3,6 @@ SELECT
c.id,
c.date,
c.notes,
'I went to (yet another) concert!' AS description,
'concert' AS type,
CONCAT('/music/concerts?id=', c.id) AS url,
CASE
WHEN c.artist IS NOT NULL THEN
@ -23,6 +19,7 @@ SELECT
json_build_object(
'name', v.name,
'name_short', trim(split_part(v.name, ',', 1)),
'latitude', v.latitude,
'longitude', v.longitude,
'notes', v.notes