Skip to content

Commit

Permalink
Don't show notification after reloading player when player is not wor…
Browse files Browse the repository at this point in the history
…king
  • Loading branch information
xfangfang committed Jul 6, 2021
1 parent 4b5806b commit ffb3593
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Macast.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def __init__(self):
rumps.debug_mode(True)

def _buildMenu(self):
self.copyItem = None
self.toggleItem = rumps.MenuItem(_("Stop Cast"),
key="p",
callback=self.toggle)
Expand Down Expand Up @@ -231,7 +232,7 @@ def playerPosition(self, sender, notify=True):
sender.state = True
macast.Setting.set(macast.SettingProperty.PlayerPosition,
sender.index)
if notify:
if notify and self.copyItem is not None:
self.notification(_("Reload Player"),
_("please wait"),
sound=False)
Expand All @@ -255,9 +256,10 @@ def playerHW(self, sender):
else:
# Default Hardware Decode
macast.Setting.set(macast.SettingProperty.PlayerHW, 1)
self.notification(_("Reload Player"),
_("please wait"),
sound=False)
if self.copyItem is not None:
self.notification(_("Reload Player"),
_("please wait"),
sound=False)
cherrypy.engine.publish('reloadRender')

def playerSize(self, sender):
Expand All @@ -268,9 +270,10 @@ def playerSize(self, sender):
if sender.index == 3:
self.playerPosition(self.playerPositionItem.items()[4][1],
notify=False)
self.notification(_("Reload Player"),
_("please wait"),
sound=False)
if self.copyItem is not None:
self.notification(_("Reload Player"),
_("please wait"),
sound=False)
cherrypy.engine.publish('reloadRender')

def autoCheckUpdate(self, sender):
Expand Down

0 comments on commit ffb3593

Please sign in to comment.