Skip to content

Commit

Permalink
Merge pull request #6 from ch1kulya/rich-implementation
Browse files Browse the repository at this point in the history
Rich implementation bug fixes
  • Loading branch information
ch1kulya authored Jan 16, 2025
2 parents c12c0d7 + be9324b commit 1a4fed4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def gradient_color(self, text: str, start_color: tuple, end_color: tuple) -> str
g = int(start_color[1] + (end_color[1] - start_color[1]) * i / len(text))
b = int(start_color[2] + (end_color[2] - start_color[2]) * i / len(text))
result += f"\033[38;2;{r};{g};{b}m{char}"
result += "\033[0m"
return result

def format_time_ago(self, delta: timedelta) -> str:
Expand Down Expand Up @@ -244,8 +245,8 @@ def videos_menu(self) -> None:
duration = f"{round(video['duration_seconds'] / 60)} min"
watched_videos = [dict(watched_video) for watched_video in self.manager.watched]
if any(video["id"] == watched_video["id"] for watched_video in watched_videos):
color = "grey"
color_time = "grey"
color = "dim"
color_time = "dim"
elif delta.days == 0:
color_time = "yellow"
elif delta.days == 1:
Expand Down

0 comments on commit 1a4fed4

Please sign in to comment.