Skip to content

Commit

Permalink
[Podcast feed update] Add tracks for refresh result (#3527)
Browse files Browse the repository at this point in the history
  • Loading branch information
mebarbosa authored Jan 31, 2025
1 parent 2baaefa commit fad5c46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,14 @@ class PodcastViewModel

_refreshState.emit(RefreshState.Refreshing(refreshType))
val newEpisodeFound = podcastManager.refreshPodcastFeed(podcast = podcast)
_refreshState.emit(if (newEpisodeFound) RefreshState.NewEpisodeFound else RefreshState.NoEpisodesFound)

if (newEpisodeFound) {
analyticsTracker.track(AnalyticsEvent.PODCAST_SCREEN_REFRESH_NEW_EPISODE_FOUND, mapOf("podcast_uuid" to podcast.uuid, "action" to refreshType.analyticsValue))
_refreshState.emit(RefreshState.NewEpisodeFound)
} else {
analyticsTracker.track(AnalyticsEvent.PODCAST_SCREEN_REFRESH_NO_EPISODES_FOUND, mapOf("podcast_uuid" to podcast.uuid, "action" to refreshType.analyticsValue))
_refreshState.emit(RefreshState.NoEpisodesFound)
}
}

private fun trackEpisodeBulkEvent(event: AnalyticsEvent, count: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ enum class AnalyticsEvent(val key: String) {
PODCASTS_SCREEN_TAB_TAPPED("podcasts_screen_tab_tapped"),
PODCAST_SCREEN_REPORT_TAPPED("podcast_screen_report_tapped"),
PODCAST_SCREEN_REFRESH_EPISODE_LIST("podcast_screen_refresh_episode_list"),
PODCAST_SCREEN_REFRESH_NEW_EPISODE_FOUND("podcast_screen_refresh_new_episode_found"),
PODCAST_SCREEN_REFRESH_NO_EPISODES_FOUND("podcast_screen_refresh_no_episodes_found"),

/* Podcast Settings */
PODCAST_SETTINGS_FEED_ERROR_TAPPED("podcast_settings_feed_error_tapped"),
Expand Down

0 comments on commit fad5c46

Please sign in to comment.