-
-
Notifications
You must be signed in to change notification settings - Fork 26
feat(#673): SetEndReason plumbing, CompletedSet persistence, firmware bounds #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b53c630
b0b1123
c0303de
6a88cde
14bbc96
d15f05f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import app.cash.sqldelight.coroutines.mapToList | |
| import com.devil.phoenixproject.database.VitruvianDatabase | ||
| import com.devil.phoenixproject.domain.model.CompletedSet | ||
| import com.devil.phoenixproject.domain.model.PlannedSet | ||
| import com.devil.phoenixproject.domain.model.SetEndReason | ||
| import com.devil.phoenixproject.domain.model.SetType | ||
| import com.devil.phoenixproject.domain.model.WorkoutSession | ||
| import com.devil.phoenixproject.domain.model.generateUUID | ||
|
|
@@ -54,6 +55,7 @@ class SqlDelightCompletedSetRepository(db: VitruvianDatabase) : CompletedSetRepo | |
| loggedRpe: Long?, | ||
| isPr: Long, | ||
| completedAt: Long, | ||
| setEndReason: String, | ||
| ): CompletedSet = CompletedSet( | ||
| id = id, | ||
| sessionId = sessionId, | ||
|
|
@@ -65,6 +67,8 @@ class SqlDelightCompletedSetRepository(db: VitruvianDatabase) : CompletedSetRepo | |
| loggedRpe = loggedRpe?.toInt(), | ||
| isPr = isPr == 1L, | ||
| completedAt = completedAt, | ||
| setEndReason = runCatching { SetEndReason.valueOf(setEndReason) } | ||
| .getOrElse { SetEndReason.TARGET_REPS_REACHED }, | ||
| ) | ||
|
|
||
| // ==================== Planned Sets ==================== | ||
|
|
@@ -178,6 +182,7 @@ class SqlDelightCompletedSetRepository(db: VitruvianDatabase) : CompletedSetRepo | |
| logged_rpe = set.loggedRpe?.toLong(), | ||
| is_pr = if (set.isPr) 1L else 0L, | ||
| completed_at = set.completedAt, | ||
| set_end_reason = set.setEndReason.name, | ||
| ) | ||
| } | ||
| } | ||
|
|
@@ -233,6 +238,7 @@ class SqlDelightCompletedSetRepository(db: VitruvianDatabase) : CompletedSetRepo | |
| logged_rpe = completedSet.loggedRpe?.toLong(), | ||
| is_pr = if (completedSet.isPr) 1L else 0L, | ||
| completed_at = completedSet.completedAt, | ||
| set_end_reason = completedSet.setEndReason.name, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a Just Lift session finishes without an exercise selected, no Useful? React with 👍 / 👎. |
||
| ) | ||
|
|
||
| completedSet | ||
|
|
@@ -252,6 +258,7 @@ class SqlDelightCompletedSetRepository(db: VitruvianDatabase) : CompletedSetRepo | |
| logged_rpe = set.loggedRpe?.toLong(), | ||
| is_pr = if (set.isPr) 1L else 0L, | ||
| completed_at = set.completedAt, | ||
| set_end_reason = set.setEndReason.name, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.