From d8301c8da29f7f515cae5c6aa49ec57e6904c410 Mon Sep 17 00:00:00 2001 From: Juan Alvarado Date: Fri, 15 Mar 2024 15:55:36 -0400 Subject: [PATCH 1/3] Add love below --- .../EpisodeList/EpisodeListSpinner.tsx | 4 +-- src/client/EpisodesScreen/EpisodesScreen.tsx | 1 + src/client/EpisodesScreen/Navbar/Logos.tsx | 35 ++++++++++++++++--- src/client/EpisodesScreen/Navbar/index.tsx | 19 ++++++---- src/client/components/Icons.tsx | 2 +- src/pages/api/internal/sync-episodes.ts | 5 +-- src/server/router.ts | 3 +- 7 files changed, 53 insertions(+), 16 deletions(-) diff --git a/src/client/EpisodesScreen/EpisodeList/EpisodeListSpinner.tsx b/src/client/EpisodesScreen/EpisodeList/EpisodeListSpinner.tsx index 502dd34..5b6805a 100644 --- a/src/client/EpisodesScreen/EpisodeList/EpisodeListSpinner.tsx +++ b/src/client/EpisodesScreen/EpisodeList/EpisodeListSpinner.tsx @@ -1,10 +1,10 @@ import React from "react"; -import { Soulector } from "../../components/Icons"; +import { Soulection } from "../../components/Icons"; export default function EpisodeListSpinner() { return (
- +
Loading Episodes
); diff --git a/src/client/EpisodesScreen/EpisodesScreen.tsx b/src/client/EpisodesScreen/EpisodesScreen.tsx index 9f55dfd..0621406 100644 --- a/src/client/EpisodesScreen/EpisodesScreen.tsx +++ b/src/client/EpisodesScreen/EpisodesScreen.tsx @@ -304,6 +304,7 @@ function setNavigatorMediaMetadata(episode: ReturnType) { const prefixMap = { soulection: "Soulection on", "sasha-marie-radio": "Sasha Marie on", + "the-love-below-hour": "The Love Below on", }; navigator.mediaSession.metadata = new MediaMetadata({ diff --git a/src/client/EpisodesScreen/Navbar/Logos.tsx b/src/client/EpisodesScreen/Navbar/Logos.tsx index 9d96d8f..9ecaf05 100644 --- a/src/client/EpisodesScreen/Navbar/Logos.tsx +++ b/src/client/EpisodesScreen/Navbar/Logos.tsx @@ -1,11 +1,20 @@ import React from "react"; -import { Soulector } from "../../components/Icons"; +import { Soulection } from "../../components/Icons"; export function SoulectionLogo() { return (
- - + + +
+ ); +} + +export function TheLoveBelowHourLogo() { + return ( +
+ +
The Love Below Hour
); } @@ -13,7 +22,7 @@ export function SoulectionLogo() { export function SashaMarieRadioLogo() { return (
- +
); } @@ -127,3 +136,21 @@ export function SashaMarioRadio(props: any) { ); } + +export function TheLoveBelowLogo(props: any) { + return ( + + + + ); +} diff --git a/src/client/EpisodesScreen/Navbar/index.tsx b/src/client/EpisodesScreen/Navbar/index.tsx index e1cc30d..534109a 100644 --- a/src/client/EpisodesScreen/Navbar/index.tsx +++ b/src/client/EpisodesScreen/Navbar/index.tsx @@ -1,6 +1,10 @@ -import { SashaMarieRadioLogo, SoulectionLogo } from "./Logos"; +import { + SashaMarieRadioLogo, + SoulectionLogo, + TheLoveBelowHourLogo, +} from "./Logos"; import React, { useEffect } from "react"; -import { IconChevron, IconSearch, Soulector } from "../../components/Icons"; +import { IconChevron, IconSearch, Soulection } from "../../components/Icons"; import NavbarSearch from "./NavbarSearch"; import cx from "classnames"; import create from "zustand"; @@ -16,6 +20,7 @@ import EpisodeListSpinner from "../EpisodeList/EpisodeListSpinner"; import { CardStackIcon } from "@radix-ui/react-icons"; import { SelectSeparator } from "@/components/ui/select"; import { cn } from "@/lib/utils"; +import { EpisodeCollectiveSlugProjection } from "@/server/router"; export type NavbarStore = { searchOpen: boolean; @@ -38,8 +43,8 @@ export const useNavbarStore = create((set, get) => ({ })); export type CollectiveSelectStore = { - selected: "all" | "soulection" | "sasha-marie-radio"; - setSelected: (collective: "all" | "soulection" | "sasha-marie-radio") => void; + selected: "all" | EpisodeCollectiveSlugProjection; + setSelected: (collective: "all" | EpisodeCollectiveSlugProjection) => void; loadPersisted: () => void; }; @@ -58,8 +63,7 @@ export const useCollectiveSelectStore = create( set({ selected: persistedCollective as | "all" - | "soulection" - | "sasha-marie-radio", + | EpisodeCollectiveSlugProjection, }); } }, @@ -123,6 +127,9 @@ export default function Navbar({ + + + diff --git a/src/client/components/Icons.tsx b/src/client/components/Icons.tsx index 3db241b..d02cec0 100644 --- a/src/client/components/Icons.tsx +++ b/src/client/components/Icons.tsx @@ -1,6 +1,6 @@ import React from "react"; -export function Soulector(props: any) { +export function Soulection(props: any) { return ( diff --git a/src/pages/api/internal/sync-episodes.ts b/src/pages/api/internal/sync-episodes.ts index 9583284..93197bd 100644 --- a/src/pages/api/internal/sync-episodes.ts +++ b/src/pages/api/internal/sync-episodes.ts @@ -13,11 +13,12 @@ function createLargeSoundCloudThumbUrl(url: string) { const playlists = { soulection: "8025093", "sasha-marie-radio": "944232886", + "the-love-below-hour": "269025488" } as const; type PlaylistSlugs = keyof typeof playlists; export async function syncAllCollectives(db: Db) { - const slugs: PlaylistSlugs[] = ["soulection", "sasha-marie-radio"]; + const slugs: PlaylistSlugs[] = ["soulection", "sasha-marie-radio", "the-love-below-hour"]; let retrieved: string[] = []; for (const s of slugs) { @@ -30,7 +31,7 @@ export async function syncAllCollectives(db: Db) { export async function getSoundCloudTracks( db: Db, - collectiveSlug: "soulection" | "sasha-marie-radio" = "soulection" + collectiveSlug: PlaylistSlugs = "soulection" ) { const soundCloudClient = new SoundCloudApiClient(); await soundCloudClient.getToken(); diff --git a/src/server/router.ts b/src/server/router.ts index c66e3f5..f5a1253 100644 --- a/src/server/router.ts +++ b/src/server/router.ts @@ -18,10 +18,11 @@ export type DBTrack = { name: string; url: string; picture_large: string; - collective_slug: "soulection" | "sasha-marie-radio"; + collective_slug: "soulection" | "sasha-marie-radio" | "the-love-below-hour"; }; export type EpisodeProjection = ReturnType; +export type EpisodeCollectiveSlugProjection = DBTrack["collective_slug"]; export function episodeProjection(t: WithId) { return { id: t._id.toString(), From 7c540351e635231dc7c3adde10e45e939d4ca8f7 Mon Sep 17 00:00:00 2001 From: Juan Alvarado Date: Fri, 15 Mar 2024 16:00:42 -0400 Subject: [PATCH 2/3] . --- src/client/EpisodesScreen/useEpisodeAlbumArtColors.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/EpisodesScreen/useEpisodeAlbumArtColors.tsx b/src/client/EpisodesScreen/useEpisodeAlbumArtColors.tsx index 96adb7f..f555c0f 100644 --- a/src/client/EpisodesScreen/useEpisodeAlbumArtColors.tsx +++ b/src/client/EpisodesScreen/useEpisodeAlbumArtColors.tsx @@ -16,8 +16,6 @@ export function useEpisodeAlbumArtColors() { useEffect(() => { if (data) { - const rgbString = data.rgb.join(" "); - const [h, s, l] = data.hsl; const hslString = `${h * 360} ${s * 100}% ${l * 100}%`; From c8191945d431da21a6ed9342a664612d2c5ec443 Mon Sep 17 00:00:00 2001 From: Juan Alvarado Date: Fri, 15 Mar 2024 16:43:21 -0400 Subject: [PATCH 3/3] Bug --- src/client/EpisodesScreen/Navbar/NavbarSearch.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/EpisodesScreen/Navbar/NavbarSearch.tsx b/src/client/EpisodesScreen/Navbar/NavbarSearch.tsx index 50ae55d..1b876f9 100644 --- a/src/client/EpisodesScreen/Navbar/NavbarSearch.tsx +++ b/src/client/EpisodesScreen/Navbar/NavbarSearch.tsx @@ -33,6 +33,7 @@ export default function NavbarSearch({ all: "Search all episodes...", soulection: "Search Soulection episodes...", "sasha-marie-radio": "Search Sasha Marie Radio episodes...", + "the-love-below-hour": "The Love Below episodes..." }; const placeHolder = placeHolderOptions[selectedCollective];