From 1eeda56b51fb6411ef5490533945daf623acdffd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 30 Jun 2026 20:07:54 +0000 Subject: [PATCH] feat: add "Mine" to the Podcasts and Podcast Episodes feed filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two podcast feeds used kind3GlobalPeopleRoutes, which omits the "Mine" option — so a creator had no way to filter the feed down to their own published shows/episodes (and the default follow-list view is usually empty for podcasts, since NIP-F4 shows are their own keypairs you rarely kind:3-follow). Add a podcastRoutes catalog in TopNavFilterState that mirrors musicRoutes (content catalog + Mine + interests + mute list) and point both podcast top bars at it. "Mine" resolves to an AuthorsTopNavPerRelayFilterSet of the user's own pubkey, which the podcast SubAssemblyHelper already dispatches through filterPodcastEventsByAuthors — so selecting it actually fetches the creator's own catalog, not a dead option. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01JGa1EM5KWyDo1o5Yr6sS18 --- .../amethyst/ui/screen/TopNavFilterState.kt | 23 +++++++++++++++++++ .../podcasts/PodcastEpisodesTopBar.kt | 7 +++--- .../loggedIn/podcasts/PodcastsTopBar.kt | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt index 9e05c1d6a9..9a2b7b26af 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt @@ -328,6 +328,24 @@ class TopNavFilterState( ) } + private val _podcastRoutes = + combineTransform( + livePeopleListsFlow, + liveInterestFlows, + ) { peopleLists, interests -> + checkNotInMainThread() + emit( + listOf( + // Same content-style catalog as kind3GlobalPeopleRoutes, plus "Mine" so the + // podcasts + episodes screens can show only the user's own published shows/episodes. + listOf(allFollows, userFollows, kind3Follows, aroundMe, globalFollow, mineFollow), + peopleLists, + interests, + listOf(muteListFollow), + ).flatten().toImmutableList(), + ) + } + private val _kind3GlobalPeople = livePeopleListsFlow.transform { peopleLists -> checkNotInMainThread() @@ -408,6 +426,11 @@ class TopNavFilterState( .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, persistentListOf(allFollows, userFollows, kind3Follows, aroundMe, globalFollow, mineFollow, muteListFollow)) + val podcastRoutes = + _podcastRoutes + .flowOn(Dispatchers.IO) + .stateIn(scope, SharingStarted.Eagerly, persistentListOf(allFollows, userFollows, kind3Follows, aroundMe, globalFollow, mineFollow, muteListFollow)) + fun destroy() { Log.d("Init") { "OnCleared: ${this.javaClass.simpleName}" } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastEpisodesTopBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastEpisodesTopBar.kt index ca40ecb546..81c27cead6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastEpisodesTopBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastEpisodesTopBar.kt @@ -62,9 +62,10 @@ private fun PodcastEpisodesTopNavFilterBar( accountViewModel: AccountViewModel, onChange: (FeedDefinition) -> Unit, ) { - // Same content-style catalog as Music/Articles — All Follows, Your Follows, kind3 - // Follows, Around Me, Global, people lists, interest sets, mute list. - val allLists by followListsModel.kind3GlobalPeopleRoutes.collectAsStateWithLifecycle() + // Same content-style catalog as Music — All Follows, Your Follows, kind3 Follows, + // Around Me, Global, Mine (the user's own published shows/episodes), people lists, + // interest sets, mute list. + val allLists by followListsModel.podcastRoutes.collectAsStateWithLifecycle() FeedFilterSpinner( placeholderCode = listName, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastsTopBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastsTopBar.kt index 28dcbeb002..9022f588d8 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastsTopBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastsTopBar.kt @@ -62,7 +62,7 @@ private fun PodcastsTopNavFilterBar( accountViewModel: AccountViewModel, onChange: (FeedDefinition) -> Unit, ) { - val allLists by followListsModel.kind3GlobalPeopleRoutes.collectAsStateWithLifecycle() + val allLists by followListsModel.podcastRoutes.collectAsStateWithLifecycle() FeedFilterSpinner( placeholderCode = listName,