Skip to content

Commit

Permalink
Timer setting implementation #23 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirdx committed Aug 14, 2023
1 parent 2536557 commit 2e4f1d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ def __rpc_update(self) -> None:
self.rpc.clear()
self.start_time = round(time.time())
return

show_timer = self.__cfg_val(self.main_cfg, 'timer', bool)
start_time = self.start_time if show_timer else None

# update Rich Presence
#! Spotify (LINUX ONLY)
Expand All @@ -134,17 +137,17 @@ def __rpc_update(self) -> None:
large_image="anki",
small_image="spotify",
small_text=spotify_info,
start=self.start_time)
start=start_time)
else:
self.rpc.update(details=self.rpc_next_details,
state=self.rpc_next_state,
large_image="anki",
start=self.start_time)
start=start_time)
else:
self.rpc.update(details=self.rpc_next_details,
state=self.rpc_next_state,
large_image="anki",
start=self.start_time)
start=start_time)
except Exception as ex:
self.connected = False
print("Couldn't update Discord Rich Presence:", ex)
Expand Down

0 comments on commit 2e4f1d3

Please sign in to comment.