diff --git a/android/app/src/main/java/com/fabledsword/minstrel/home/ui/HomeScreen.kt b/android/app/src/main/java/com/fabledsword/minstrel/home/ui/HomeScreen.kt index e3d047fb..598b88c1 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/home/ui/HomeScreen.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/home/ui/HomeScreen.kt @@ -95,6 +95,7 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.stateIn +import kotlinx.coroutines.flow.filter import kotlinx.coroutines.launch import javax.inject.Inject @@ -139,6 +140,7 @@ class HomeViewModel @Inject constructor( private val libraryRepository: LibraryRepository, private val player: com.fabledsword.minstrel.player.PlayerController, private val shuffleSource: com.fabledsword.minstrel.cache.ShuffleSource, + private val eventsStream: com.fabledsword.minstrel.events.EventsStream, networkStatus: com.fabledsword.minstrel.connectivity.NetworkStatusController, ) : ViewModel() { @@ -167,6 +169,15 @@ class HomeViewModel @Inject constructor( init { refresh() + // #968: the daily 03:00 rebuild (and manual refresh) emit + // playlist.system_rebuilt; re-pull Home so the system-playlist tiles + // and You-might-like rows reflect the new snapshot without a manual + // reload. Mirrors the web SSE consumer. + viewModelScope.launch { + eventsStream.events + .filter { it.kind == "playlist.system_rebuilt" } + .collect { refresh() } + } } /**