mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 06:32:36 +00:00
A few more minor Kotlin cleanups.
This commit is contained in:
parent
ab58993c0f
commit
dae40fba2a
@ -14,7 +14,10 @@ import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import android.widget.CheckBox
|
||||
import android.widget.CompoundButton
|
||||
import android.widget.SeekBar
|
||||
import android.widget.TextView
|
||||
import io.casey.musikcube.remote.playback.PlaybackService
|
||||
import io.casey.musikcube.remote.playback.PlaybackState
|
||||
import io.casey.musikcube.remote.playback.RepeatMode
|
||||
|
@ -771,20 +771,21 @@ class StreamingPlaybackService(context: Context) : PlaybackService {
|
||||
|
||||
override val playlistQueryFactory: TrackListSlidingWindow.QueryFactory = object : TrackListSlidingWindow.QueryFactory() {
|
||||
override fun getRequeryMessage(): SocketMessage? {
|
||||
val params = params
|
||||
if (params != null) {
|
||||
if (Strings.notEmpty(params?.category) && (params?.categoryId ?: -1) >= 0) {
|
||||
if (Strings.notEmpty(params.category) && (params.categoryId >= 0)) {
|
||||
return SocketMessage.Builder
|
||||
.request(Messages.Request.QueryTracksByCategory)
|
||||
.addOption(Messages.Key.CATEGORY, params?.category)
|
||||
.addOption(Messages.Key.ID, params?.categoryId)
|
||||
.addOption(Messages.Key.FILTER, params?.filter)
|
||||
.addOption(Messages.Key.CATEGORY, params.category)
|
||||
.addOption(Messages.Key.ID, params.categoryId)
|
||||
.addOption(Messages.Key.FILTER, params.filter)
|
||||
.addOption(Messages.Key.COUNT_ONLY, true)
|
||||
.build()
|
||||
}
|
||||
else {
|
||||
return SocketMessage.Builder
|
||||
.request(Messages.Request.QueryTracks)
|
||||
.addOption(Messages.Key.FILTER, params?.filter)
|
||||
.addOption(Messages.Key.FILTER, params.filter)
|
||||
.addOption(Messages.Key.COUNT_ONLY, true)
|
||||
.build()
|
||||
}
|
||||
@ -794,13 +795,14 @@ class StreamingPlaybackService(context: Context) : PlaybackService {
|
||||
}
|
||||
|
||||
override fun getPageAroundMessage(offset: Int, limit: Int): SocketMessage? {
|
||||
val params = params
|
||||
if (params != null) {
|
||||
if (Strings.notEmpty(params?.category) && (params?.categoryId ?: -1) >= 0) {
|
||||
if (Strings.notEmpty(params.category) && (params.categoryId >= 0)) {
|
||||
return SocketMessage.Builder
|
||||
.request(Messages.Request.QueryTracksByCategory)
|
||||
.addOption(Messages.Key.CATEGORY, params?.category)
|
||||
.addOption(Messages.Key.ID, params?.categoryId)
|
||||
.addOption(Messages.Key.FILTER, params?.filter)
|
||||
.addOption(Messages.Key.CATEGORY, params.category)
|
||||
.addOption(Messages.Key.ID, params.categoryId)
|
||||
.addOption(Messages.Key.FILTER, params.filter)
|
||||
.addOption(Messages.Key.LIMIT, limit)
|
||||
.addOption(Messages.Key.OFFSET, offset)
|
||||
.build()
|
||||
@ -808,7 +810,7 @@ class StreamingPlaybackService(context: Context) : PlaybackService {
|
||||
else {
|
||||
return SocketMessage.Builder
|
||||
.request(Messages.Request.QueryTracks)
|
||||
.addOption(Messages.Key.FILTER, params?.filter)
|
||||
.addOption(Messages.Key.FILTER, params.filter)
|
||||
.addOption(Messages.Key.LIMIT, limit)
|
||||
.addOption(Messages.Key.OFFSET, offset)
|
||||
.build()
|
||||
|
Loading…
x
Reference in New Issue
Block a user