Skip to content

Commit

Permalink
Show sessions complete during each break
Browse files Browse the repository at this point in the history
  • Loading branch information
jake158 committed Apr 4, 2024
1 parent 5eac955 commit 39e17f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pomodorodiscord/src/pomodoro_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def initialize_rpc(self):
def update_rpc(self):
while True:
if self.break_running:
self.rpc.break_state(self.start_time_timestamp, self.end_time_timestamp)
self.rpc.break_state(self.session_counter, self.start_time_timestamp, self.end_time_timestamp)
elif self.running:
self.rpc.running_state(self.session_counter + 1, self.start_time_timestamp, self.end_time_timestamp)
else:
Expand Down
11 changes: 7 additions & 4 deletions pomodorodiscord/src/richpresence.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ def __init__(self):
print(f"Failed to connect to Discord: {e}")

def default_state(self):
self.update(state="Idling", details=None, large_image="graytomato")
self.update(state="Idling", details=None, large_image="graytomato",
large_text="github.com/freeram/pomodoro-discord")

def running_state(self, session, start_time, end_time):
self.update(state=f"Session {session}", details="Studying", start=start_time, end=end_time, large_image="tomato")
self.update(state=f"Session {session}", details="Studying", start=start_time,
end=end_time, large_image="tomato", large_text="github.com/freeram/pomodoro-discord")

def break_state(self, start_time, end_time):
self.update(state="On break", details=None, start=start_time, end=end_time, large_image="greentomato")
def break_state(self, complete, start_time, end_time):
self.update(state=f"On break. Sessions completed: {complete}", details=None, start=start_time,
end=end_time, large_image="greentomato", large_text="github.com/freeram/pomodoro-discord")

0 comments on commit 39e17f7

Please sign in to comment.