Skip to content

Commit

Permalink
Fix crash parsing new TaA workout IDs. fix #17
Browse files Browse the repository at this point in the history
  • Loading branch information
gazpachoking committed Feb 13, 2022
1 parent 0bace15 commit 599b092
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "trainaspower"
version = "0.7.3"
version = "0.7.4"
description = "Convert TrainAsOne plans to power and upload to Final Surge for use with Stryd pod."
authors = ["Chase Sterling <[email protected]>"]
license = "MIT"
Expand Down
4 changes: 1 addition & 3 deletions trainaspower/trainasone.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ def get_workout(workout_url: str, date: datetime.date, config: models.Config) ->
workout_json = r.json()
steps = workout_json["steps"]
title = workout_json["workoutName"]
m = re.match("^W([A-Z\d]+)@? (.*)", title)
number = m.group(1)
name = m.group(2).strip()
number, name = title.split(' ', maxsplit=1)
w.id = number
w.name = f"{number} {name}"

Expand Down

0 comments on commit 599b092

Please sign in to comment.