-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix where zones_seek_changed empties cache
- Loading branch information
Floris Jan Galesloot
committed
Jul 28, 2020
1 parent
399ac18
commit e73da76
Showing
1 changed file
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,7 +238,7 @@ function makelayout(settings) { | |
var roon = new RoonApi({ | ||
extension_id: 'nl.fjgalesloot.mqtt', | ||
display_name: "MQTT Extension", | ||
display_version: "1.0", | ||
display_version: "1.1", | ||
publisher: 'Floris Jan Galesloot', | ||
email: '[email protected]', | ||
website: 'https://github.com/fjgalesloot/roon-extension-mqtt', | ||
|
@@ -267,7 +267,13 @@ var roon = new RoonApi({ | |
//var regex = ''; | ||
if ( zonename ) { | ||
zonename = zonename.replace(/ \+.*/,''); | ||
roon_zones[zonename] = JSON.parse(JSON.stringify(zonedata)); | ||
if ( zoneevent !='zones_seek_changed' ) { | ||
// zones_seek_changed only passes seek/queue position. Do not refresh zone cache | ||
roon_zones[zonename] = JSON.parse(JSON.stringify(zonedata)); | ||
} else { | ||
roon_zones[zonename].queue_time_remaining = zonedata.queue_time_remaining; | ||
roon_zones[zonename].seek_position = zonedata.seek_position; | ||
} | ||
if ( debug ) { console.log('*** publising(if needed) to zone %s: %s', zonename, JSON.stringify(zonedata)); } | ||
mqtt_publish_JSON( 'roon/'+zonename, mqtt_client, zonedata); | ||
} | ||
|