mirror of
https://github.com/shadoll/playing_now_2_mm.git
synced 2025-12-20 03:26:51 +00:00
Refactor sleep logic in main.py and update status_send.py
This commit is contained in:
5
main.py
5
main.py
@@ -38,7 +38,10 @@ def main(source: str = "autodetect", destination: str = "mattermost"):
|
||||
status_curr = status
|
||||
if not status_result:
|
||||
continue
|
||||
time.sleep(status.get("duration") or SLEEP_TIME)
|
||||
sleep = status.get("remaining_time") or status.get("duration")
|
||||
if sleep is None or sleep <= 0:
|
||||
sleep = SLEEP_TIME
|
||||
time.sleep(sleep)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user