Do not request artwork if not available (#7189)

This should fix the "dancing media player" issue where the media player
requests artwork when it's not really available, making the UI "dance".
This commit is contained in:
Pierre Ståhl authored and Paulus Schoutsen committed 2017-04-20 00:10:06 -07:00
1 parent 2e11d49af3
commit 93820d5124
1 file changed
+2 -1
@@ -145,6 +145,8 @@ class AppleTvDevice(MediaPlayerDevice):
@callback
def playstatus_update(self, updater, playing):
"""Print what is currently playing when it changes."""
self._playing = playing
if self.state == STATE_IDLE:
self._artwork_hash = None
elif self._has_playing_media_changed(playing):
@@ -153,7 +155,6 @@ class AppleTvDevice(MediaPlayerDevice):
self._artwork_hash = hashlib.md5(
base.encode('utf-8')).hexdigest()
self._playing = playing
self.hass.async_add_job(self.async_update_ha_state())
def _has_playing_media_changed(self, new_playing):