Skip to content

Commit e83466d

Browse files
committed
fixed crash in playFav
1 parent 9b82caf commit e83466d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

plugins/SonosPlugin/SonosCoordinator.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,19 @@ SonosCoordinator.prototype.playFav = function(playername,title) {
205205

206206

207207

208-
if (item.title==title) {
209-
selItem.uri = selItem.uri.split("&").join("&");
208+
if (item.title === title) {
209+
that.log.debug("Selected %s",JSON.stringify(item))
210+
item.uri = item.uri.split("&").join("&");
211+
item.uri = item.uri.replace("sid=254&flags=8224&sn=0","sid=254&flags=32")
210212
// Quick and f*cking dirty
211-
playerDevice.sonos.queueNext(item,function(err,result){
213+
playerDevice.sonos.stop(function(){
214+
playerDevice.sonos.flush(function(){
215+
playerDevice.sonos.queue(item,function(err,result){
212216
playerDevice.sonos.play();
213-
});
214-
}
217+
})
218+
})
219+
})
220+
}
215221
});
216222
});
217223
} else {

plugins/SonosPlugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "homematic-virtual-sonosdevice",
3-
"version": "0.0.20",
3+
"version": "0.0.21",
44
"description": "Virtual Sonos Device",
55
"license": "ISC",
66
"keywords": [

0 commit comments

Comments
 (0)