Fallback to filename for title in vlc_telnet (#48438)

PR extracted from #44776.
This commit is contained in:
David McClosky 2021-03-28 13:39:36 -04:00 committed by GitHub
parent 48c0cfb25c
commit 23c7c4c977
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,6 +156,12 @@ class VlcDevice(MediaPlayerEntity):
self._media_artist = info.get(0, {}).get("artist")
self._media_title = info.get(0, {}).get("title")
if not self._media_title:
# Fall back to filename.
data_info = info.get("data")
if data_info:
self._media_title = data_info["filename"]
except (CommandError, LuaError, ParseError) as err:
_LOGGER.error("Command error: %s", err)
except (ConnErr, EOFError) as err: