From 975e0470ae3d30b813e1b1161aa59a9cf1227628 Mon Sep 17 00:00:00 2001 From: Martin Wagner Date: Sun, 4 Jul 2021 22:42:12 +0200 Subject: [PATCH] don't show "AudioType" when format is empty --- bin/mpdevil | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/mpdevil b/bin/mpdevil index 08d8bdd..25df90e 100755 --- a/bin/mpdevil +++ b/bin/mpdevil @@ -2738,7 +2738,7 @@ class AudioType(Gtk.Label): def __init__(self, client): super().__init__() self._client=client - self._format, self._brate, self._file_type=("::", 0.0, "") + self._format, self._brate, self._file_type=("", 0.0, "") # connect self._client.emitter.connect("audio", self._on_audio) @@ -2749,11 +2749,12 @@ class AudioType(Gtk.Label): def clear(self, *args): self.set_text("") - self._format, self._brate, self._file_type=("::", 0.0, "") + self._format, self._brate, self._file_type=("", 0.0, "") def _refresh(self, *args): - string="{} kb/s • {} • {}".format(locale.str(self._brate), ClientHelper.convert_audio_format(self._format), self._file_type) - self.set_text(string) + if self._format != "": + string="{} kb/s • {} • {}".format(locale.str(self._brate), ClientHelper.convert_audio_format(self._format), self._file_type) + self.set_text(string) def _on_audio(self, emitter, audio_format): self._format=audio_format