Skip to content

Commit

Permalink
next at end of queu ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
hklages committed Apr 9, 2024
1 parent d23b872 commit 64c36d8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sonos-universal.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,15 +925,15 @@ module.exports = function (RED) {
const groupData = await getGroupCurrent(tsPlayer, validated.playerName)
const tsCoordinator = new SonosDevice(groupData.members[0].urlObject.hostname)

// changed according to issue #281
// At end of a queue, non repeat mode: ignore the Next
try {
await tsCoordinator.AVTransportService.Next({ InstanceID: 0 })
} catch (error) {
if (error.UpnpErrorCode === 711) {
await tsCoordinator.AVTransportService.Seek({
InstanceID: 0,
Target: '00:00:01',
Unit: 'REL_TIME',
})

// ignore this

} else if (error.UpnpErrorCode === 701) {
throw new Error(
`${PACKAGE_PREFIX} most likely stream (station) does not support next`
Expand Down Expand Up @@ -1651,6 +1651,8 @@ module.exports = function (RED) {
const groupData = await getGroupCurrent(tsPlayer, validated.playerName)
const tsCoordinator = new SonosDevice(groupData.members[0].urlObject.hostname)

// changed according to issue #281
// At begin of a queue, non repeat mode: repeat the current song
try {
await tsCoordinator.AVTransportService.Previous({ InstanceID: 0 })
} catch (error) {
Expand Down

0 comments on commit 64c36d8

Please sign in to comment.