mirror of
https://github.com/jellyfin/jellyfin-mpv-shim.git
synced 2024-11-30 09:40:44 +00:00
31 lines
660 B
Python
31 lines
660 B
Python
import threading
|
|
|
|
from .player import playerManager
|
|
|
|
|
|
class ActionThread(threading.Thread):
|
|
def __init__(self):
|
|
self.trigger = threading.Event()
|
|
self.halt = False
|
|
|
|
threading.Thread.__init__(self)
|
|
|
|
def stop(self):
|
|
self.halt = True
|
|
self.trigger.set()
|
|
self.join()
|
|
|
|
def run(self):
|
|
force_next = False
|
|
while not self.halt:
|
|
if playerManager.is_active() or force_next:
|
|
playerManager.update()
|
|
|
|
force_next = False
|
|
if self.trigger.wait(1):
|
|
force_next = True
|
|
self.trigger.clear()
|
|
|
|
|
|
actionThread = ActionThread()
|