From 2f25e1b650d4173f35af55ebad296274dfc11f12 Mon Sep 17 00:00:00 2001 From: Jerome Fitzgerald Date: Mon, 17 Jun 2024 20:20:05 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20=20NICE-125=20event=20info=20+?= =?UTF-8?q?=20skip=20music=20api=20[b]=20(#2558)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spotify API is kind of like ... not working. So this should be a direct Redis Cache hit in the menatime and something is really making it take forever. We know what the data is. Just set it and forget it until this needs to be dynamic again. --- .../_components/Currently.Music.Client.tsx | 29 ++++++++++------ .../playground/2024/_components/Currently.tsx | 2 +- sites/jeromefitzgerald.com/src/app/sitemap.ts | 15 ++++++-- .../jeromefitzgerald.com/src/store/index.tsx | 34 ++++++++++++------- 4 files changed, 53 insertions(+), 27 deletions(-) diff --git a/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.Music.Client.tsx b/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.Music.Client.tsx index 40c223f9d..3b9701a51 100644 --- a/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.Music.Client.tsx +++ b/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.Music.Client.tsx @@ -1,34 +1,41 @@ 'use client' -import { fetcher } from '@jeromefitz/shared/lib' +/** + * @todo(api) NICE-125 this takes way too long to run + * on what should be a redis cache hit + */ +// import { fetcher } from '@jeromefitz/shared/lib' -import useSWR from 'swr' +// import useSWR from 'swr' -import { INIT, getKey } from '@/utils/getKey' +// import { INIT, getKey } from '@/utils/getKey' import { CurrentlyItem } from './Currently.Item' import { CurrentlyWrapper } from './Currently.Item.Wrapper' -const key = getKey(0, { ...INIT, time_range: 'long_term', type: 'top-tracks' }) -const options = {} +// const key = getKey(0, { ...INIT, time_range: 'long_term', type: 'top-tracks' }) +// const options = {} function CurrentlyMusicClient({ titleSub, ...c }) { const { color, href, icon, id, title } = c const propsParent = { color, href, icon, id, title } - const { data, error, isLoading } = useSWR(key, fetcher, options) + // const { data, error, isLoading } = useSWR(key, fetcher, options) - const hasError = !!error + // const hasError = !!error // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - const top = hasError ? {} : data?.items[0] + // const top = hasError ? {} : data?.items[0] - const headline = hasError ? titleSub[0] : top?.artist - const subline = hasError ? titleSub[1] : top?.album?.name + // const headline = hasError ? titleSub[0] : top?.artist + // const subline = hasError ? titleSub[1] : top?.album?.name + + const headline = titleSub[0] + const subline = titleSub[1] const props = { headline, id, - isLoading, + isLoading: false, subline, } diff --git a/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.tsx b/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.tsx index 8f7b4da22..073fc66f0 100644 --- a/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.tsx +++ b/sites/jeromefitzgerald.com/src/app/playground/2024/_components/Currently.tsx @@ -36,7 +36,7 @@ const currently = [ id: 'listening', isActive: true, title: 'I’m Listening To…', - titleSub: 'Jessica Pratt – Here in the Pitch', + titleSub: 'Cam Chambers, Nice Rec – Check Please', }, { apiUrl: '', diff --git a/sites/jeromefitzgerald.com/src/app/sitemap.ts b/sites/jeromefitzgerald.com/src/app/sitemap.ts index af7961363..d5a94aa49 100644 --- a/sites/jeromefitzgerald.com/src/app/sitemap.ts +++ b/sites/jeromefitzgerald.com/src/app/sitemap.ts @@ -8,7 +8,14 @@ const siteUrl = 'https://jeromefitzgerald.com' const lastModified = new Date() const root = [''] -const currently = ['listening-to', 'reading'] +const currently = [ + // 'cooking', + 'listening-to', + 'reading', +] +/** + * @todo(dynamic) start somewhere though + */ const events = [ '2023/06/01/your-act', '2023/06/10/the-playlist', @@ -44,8 +51,10 @@ const events = [ '2024/03/23/sketch-madness', '2024/04/13/arcade-hootenanny', '2024/05/10/the-latchkey-kids', - // '2024/05/18/the-playlist', - '2024/06/15/the-playlist', + '2024/06/06/your-act', + '2024/07/13/arcade-hootenanny', + // '2024/07/18/sketch-comedy-lab-best-of', + // '2024/07/19/sketch-comedy-lab-best-of', ] const pages = [ 'about', diff --git a/sites/jeromefitzgerald.com/src/store/index.tsx b/sites/jeromefitzgerald.com/src/store/index.tsx index 9216d14e6..605e6ee5b 100644 --- a/sites/jeromefitzgerald.com/src/store/index.tsx +++ b/sites/jeromefitzgerald.com/src/store/index.tsx @@ -203,24 +203,34 @@ const getDefaultInitialStateStoreMenu = () => ({ titleDescription: 'Including recent past events.', }, { - href: '/events/2024/05/10/the-latchkey-kids', + href: '/events/2024/07/13/arcade-hootenanny', icon: TicketIcon, - id: '2024/05/10/the-latchkey-kids', + id: '2024/07/13/arcade-hootenanny', + isActive: true, + isActiveMobile: true, + keywords: ['arcade', 'hootenanny', 'improv'], + title: 'Arcade Hootenanny: SAT 07/13', + titleDescription: '', + }, + { + href: '/events/2024/07/18/sketch-comedy-lab-best-of', + icon: TicketIcon, + id: '2024/07/18/sketch-comedy-lab-best-of', isActive: false, isActiveMobile: false, - keywords: ['latchkey', 'kids', 'warp', 'zone'], - title: 'Latchkey Kids: SAT 05/10', - titleDescription: 'Psst – Warp Zone are special guests. Pass it on.', + keywords: ['sketch', 'comedy', 'lab'], + title: 'Sketch Comedy Lab: THU 07/18', + titleDescription: '', }, { - href: '/events/2024/06/06/your-act', + href: '/events/2024/07/19/sketch-comedy-lab-best-of', icon: TicketIcon, - id: '2024/06/06/your-act', - isActive: true, - isActiveMobile: true, - keywords: ['your', 'act', 'nonsense'], - title: 'Your ACT: THU 06/06', - titleDescription: 'Your ACT with Nonsense', + id: '2024/07/19/sketch-comedy-lab-best-of', + isActive: false, + isActiveMobile: false, + keywords: ['sketch', 'comedy', 'lab'], + title: 'Sketch Comedy Lab: FRI 07/19', + titleDescription: '', }, ], podcasts: [