fix skipping within queue while playing in a context
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
b5f76fb321
commit
efb03c1aad
@ -25,6 +25,6 @@ var nextCmd = &cobra.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return commands.Next(ctx, skipAmt)
|
return commands.Next(ctx, skipAmt, false)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -793,7 +793,13 @@ func (c *Commands) Unlike(ctx *gctx.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commands) Next(ctx *gctx.Context, amt int) error {
|
func (c *Commands) Next(ctx *gctx.Context, amt int, inqueue bool) error {
|
||||||
|
if inqueue {
|
||||||
|
for i := 0; i < amt; i++ {
|
||||||
|
c.Client().Next(ctx)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if amt == 1 {
|
if amt == 1 {
|
||||||
err := c.Client().Next(ctx)
|
err := c.Client().Next(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -86,14 +86,14 @@ func HandlePlayTrack(ctx *gctx.Context, commands *commands.Commands, track spoti
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = commands.Next(ctx, 1)
|
err = commands.Next(ctx, 1, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func HandleSkipWithinContext(ctx *gctx.Context, commands *commands.Commands, amt int) {
|
func HandleNextInQueue(ctx *gctx.Context, commands *commands.Commands, amt int) {
|
||||||
err := commands.Next(ctx, amt)
|
err := commands.Next(ctx, amt, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ func (m *mainModel) SelectItem() error {
|
|||||||
case Queue:
|
case Queue:
|
||||||
page = 1
|
page = 1
|
||||||
go func() {
|
go func() {
|
||||||
HandleSkipWithinContext(m.ctx, m.commands, m.list.Index())
|
HandleNextInQueue(m.ctx, m.commands, m.list.Index())
|
||||||
new_items, err := QueueView(m.ctx, m.commands)
|
new_items, err := QueueView(m.ctx, m.commands)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user