Skip to content

Commit

Permalink
chore: add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tooxo authored and devgianlu committed Aug 22, 2024
1 parent 2c86cac commit 9da1361
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/daemon/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ func (p *AppPlayer) handlePlayerCommand(req dealer.RequestPayload) error {
return true
} else if len(req.Command.Options.SkipTo.TrackUri) > 0 && req.Command.Options.SkipTo.TrackUri == track.Uri {
return true
// the following length checks are needed, because the TrackIndex corresponds to an offset relative to the current playlist or album
// If there are multiple albums in the current context (e.g. when starting from an artists page, the TrackIndex would indicate, that
// you started the xth track vom the first album, even if you started the xth track from the second or third album etc.)
} else if req.Command.Options.SkipTo.TrackIndex != 0 && len(req.Command.Options.SkipTo.TrackUri) == 0 && len(req.Command.Options.SkipTo.TrackUid) == 0 {
index += 1
return index == req.Command.Options.SkipTo.TrackIndex
Expand Down

0 comments on commit 9da1361

Please sign in to comment.