Skip to content

Commit

Permalink
Fix current play queue sync (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
siper authored Jan 20, 2025
1 parent 7accb97 commit d60840f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data class PlayQueueResponse(
@JsonClass(generateAdapter = true)
data class PlayQueue(
@Json(name = "current")
val current: Long?,
val current: String?,
@Json(name = "position")
val position: Long,
@Json(name = "username")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ internal class ApiSonicPlayQueueSyncer(private val apiProvider: ApiProvider) {
} ?: return

val items = playQueue.entry.map { it.toMediaItem(apiProvider) }
val currentIndex = items
.indexOfFirst { it.mediaId == playQueue.current?.toString() }
val currentIndex = items.indexOfFirst { it.mediaId == playQueue.current }
val position = playQueue.position

if (currentIndex != -1) {
Expand Down

0 comments on commit d60840f

Please sign in to comment.