playback: fix detail remember shuffle
Fix remember shuffle not working in the detail views.
This commit is contained in:
@@ -100,19 +100,19 @@ class PlaybackViewModel(application: Application) :
|
||||
|
||||
/** Play a song from it's album. */
|
||||
fun playFromAlbum(song: Song) {
|
||||
playbackManager.play(song, song.album, settings, false)
|
||||
playbackManager.play(song, song.album, settings)
|
||||
}
|
||||
|
||||
/** Play a song from it's artist. */
|
||||
fun playFromArtist(song: Song, artist: Artist) {
|
||||
check(artist.songs.contains(song)) { "Invalid input: Artist is not linked to song" }
|
||||
playbackManager.play(song, artist, settings, false)
|
||||
playbackManager.play(song, artist, settings)
|
||||
}
|
||||
|
||||
/** Play a song from the specific genre that contains the song. */
|
||||
fun playFromGenre(song: Song, genre: Genre) {
|
||||
check(genre.songs.contains(song)) { "Invalid input: Genre is not linked to song" }
|
||||
playbackManager.play(song, genre, settings, false)
|
||||
playbackManager.play(song, genre, settings)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,6 @@ import org.oxycblt.auxio.BuildConfig
|
||||
import org.oxycblt.auxio.util.isLandscape
|
||||
import org.oxycblt.auxio.util.logD
|
||||
import org.oxycblt.auxio.util.logW
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
|
||||
/**
|
||||
* Auxio's one and only appwidget. This widget follows a more unorthodox approach, effectively
|
||||
@@ -170,9 +169,9 @@ class WidgetProvider : AppWidgetProvider() {
|
||||
|
||||
val layout =
|
||||
candidates.maxByOrNull { it.height * it.width }
|
||||
?: unlikelyToBeNull(views.minOfOrNull { it.key.width * it.key.height })
|
||||
?: views.minBy { it.key.width * it.key.height }.key
|
||||
|
||||
logD("Using widget layout $layout")
|
||||
logD("Using widget layout $layout ${views.contains(layout)}")
|
||||
updateAppWidget(id, views[layout])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user