From 8313f0099167b7181c24ddc2f2f376108dbe6438 Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Mon, 13 Jun 2016 16:30:24 +0000 Subject: [PATCH] 37_plex.pm: change order of oder of events for offline players git-svn-id: https://svn.fhem.de/fhem/trunk@11654 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/37_plex.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/37_plex.pm b/fhem/FHEM/37_plex.pm index ebaa88550..ddab68657 100644 --- a/fhem/FHEM/37_plex.pm +++ b/fhem/FHEM/37_plex.pm @@ -2309,12 +2309,13 @@ plex_disappeared($$$) delete $chash->{controllable}; delete $chash->{currentMediaType}; - CommandDeleteReading( undef, "$chash->{NAME} currentTitle|currentAlbum|currentArtist|episode|series|key|cover|duration|type|track|playQueueID|playQueueItemID|server|section|shuffle|repeat" ) if( AttrVal($chash->{NAME}, 'removeUnusedReadings', 0 ); - readingsBeginUpdate($chash); readingsBulkUpdate($chash, 'presence', 'absent' ); readingsBulkUpdate($chash, 'state', 'disappeared' ); readingsEndUpdate($chash, 1); + + CommandDeleteReading( undef, "$chash->{NAME} currentTitle|currentAlbum|currentArtist|episode|series|key|cover|duration|type|track|playQueueID|playQueueItemID|server|section|shuffle|repeat" ) if( AttrVal($chash->{NAME}, 'removeUnusedReadings', 0 ); + } } @@ -2434,6 +2435,7 @@ plex_parseTimeline($$$) } else { delete $chash->{currentMediaType}; + #FIXME: move after stop event CommandDeleteReading( undef, "$chash->{NAME} currentTitle|currentAlbum|currentArtist|episode|series|key|cover|duration|type|track|playQueueID|playQueueItemID|server|section|shuffle|repeat" ) if( AttrVal($chash->{NAME}, 'removeUnusedReadings', 0 ); }