-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mpris Player position is being updated automatically #122
Comments
sorry I misunderstood it, so I folded my comments here.
@Utils.run_in_thread
def __sync_position(self) -> None:
while True:
position = self.__player_proxy.Position
if position:
self._position = position // 1_000_000
self.notify("position")
time.sleep(1) so you'll need to compare it with the earlier value before printing: self._position = player.get_position()
def print_and_return(pos: int):
if pos != self._position:
self._position = pos
print("position changed:", pos)
return f"{pos}"
Widget.Label(label=player.bind("position", print_and_return)) and, yes, I agree that this should be done by the |
Thanks for the tip! Fixed in 77b16d7 |
I can reproduce with firefox, but can't with spotify. @Utils.run_in_thread
def __sync_position(self) -> None:
while True:
position = self.__player_proxy.Position
print(position) # here
if position:
self._position = position // 1_000_000
self.notify("position")
time.sleep(1) If you try to print a position value directly from D-Bus, you will get the same problem (in case firefox). |
Yeah, I am also getting this problem on Zen-browser only 😢 |
Already reported ? *
Regression?
Yes
System Information
I don't know why is this happening
Description
Okay so I ran a code to print the position of mpris player, then I paused it.
However, position is still being updated and printed
( Sorry, I mistakenly issued this in your dotfiles repo first )
How to reproduce
I guess it should be reproduced if you try to print the position by binding it
Logs, images, videos, config files, CSS/SCSS files
No response
The text was updated successfully, but these errors were encountered: