Skip to content

Commit

Permalink
GH-17: Add total for progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-ueding committed Feb 3, 2024
1 parent e77cfe7 commit 82e9170
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions geo_activity_playground/core/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def __init__(self) -> None:

self._loose_activities: list[ActivityMeta] = []

def __len__(self) -> int:
return len(self.meta)

def add_activity(self, activity_meta: ActivityMeta) -> None:
self._loose_activities.append(activity_meta)

Expand Down
1 change: 1 addition & 0 deletions geo_activity_playground/importers/strava_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def download_missing_calories(repository: ActivityRepository) -> None:
for activity in tqdm(
client.get_activities(after="2000-01-01T00:00:00Z"),
desc="Downloading calories from Strava",
total=len(repository),
):
if repository.has_activity(activity.id):
calories = get_detailed_activity(activity.id, client).calories
Expand Down

0 comments on commit 82e9170

Please sign in to comment.