fix android desktop card bugs
This commit is contained in:
+6
-6
@@ -590,7 +590,7 @@ object AppContainer {
|
||||
homeWidgetJob = scope.launch {
|
||||
player.state
|
||||
.map { st ->
|
||||
Triple(st.current?.musicId, st.isPlaying, st.current?.isLove == true)
|
||||
st.current to st.isPlaying
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
.collect {
|
||||
@@ -675,13 +675,13 @@ object AppContainer {
|
||||
updateCover: Boolean = true,
|
||||
) {
|
||||
val st = player.state.value
|
||||
val current = st.current ?: return
|
||||
val coverPath = if (updateCover) widgetCoverCache.resolveForWidget(current) else null
|
||||
val current = st.current
|
||||
val coverPath = if (updateCover && current != null) widgetCoverCache.resolveForWidget(current) else null
|
||||
PlatformServices.homeWidget.update(
|
||||
songName = current.musicName,
|
||||
artist = current.artist,
|
||||
songName = current?.musicName,
|
||||
artist = current?.artist,
|
||||
isPlaying = st.isPlaying,
|
||||
favorite = current.isLove == true,
|
||||
favorite = current?.isLove == true,
|
||||
coverPath = coverPath,
|
||||
playText = I18n.t("play_text"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user