Skip to content

Commit

Permalink
Merge pull request #549 from philosowaffle/issue/541
Browse files Browse the repository at this point in the history
[541] fix garmin MFA flow
[546] add exercises
[547] update documentation for github actions
  • Loading branch information
philosowaffle authored Oct 7, 2023
2 parents 8321bde + d5501b0 commit 1808577
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
10 changes: 9 additions & 1 deletion docs/install/github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Once you've created your fork, you'll need to set a number of secrets in your re

1. From your forked copy of P2G, click the `Settings`
1. Then, on the side nav, select `Secrets` and then `Actions`.
1. Continue on to the [Action Permissions](#action-permissions) instructions below

From this point on you can add secrets by clicking the `New repository secret` button at the top right.

Expand All @@ -37,9 +38,16 @@ From this point on you can add secrets by clicking the `New repository secret` b
| `P2G_GARMIN__PASSWORD` | The password that you use to log into Garmin |
| `DEVICE_INFO` | The contents of the deviceInfo.xml that you want to use for the sync |

## Action Permissions

1. From your forked copy of P2G, click the `Settings` tab
1. Navigate to the settings for `Actions > General`
1. Under `Action Permissions` choose the 4th radio button titled: "Allow <youruser>, and select non-<youruser>, actions and reusable workflows".
1. Under the same radio button, check the checkbox to "Allow actions created by GitHub"

## Starting the workflow

Once you've configured your secrets, you can then navigate to the `Actions` tab within your repository.
Once you've configured your secrets, you can then navigate to the `Actions` tab within your repository.

1. Enable actions for your fork.
1. You can now run the `Sync workflow` manually
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public static class Constants
public const string ConsoleAppName = "p2g_console";
public const string ApiName = "p2g_api";
public const string WebUIName = "p2g_webui";
public const string AppVersion = "3.6.0-rc";
public const string AppVersion = "3.6.0";
}
}
12 changes: 10 additions & 2 deletions src/Conversion/ExerciseMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public static class ExerciseMapping
public static IReadOnlyCollection<string> IgnoredPelotonExercises = new HashSet<string>()
{
// A
/* Active Recovery */ "b067c9f7a1e4412190b0f8eb3c6128e3",
/* AMRAP */ "98cde50f696746ff98727d5362229cfb",

// D
Expand All @@ -23,7 +24,8 @@ public static class ExerciseMapping
public static readonly Dictionary<string, GarminExercise> StrengthExerciseMappings = new()
{
// A
/* Arnold Press */ { "01251235527748368069f9dc898aadf3", new (ExerciseCategory.ShoulderPress, ShoulderPressExerciseName.ArnoldPress) },
/* Arnold Press */ { "01251235527748368069f9dc898aadf3", new (ExerciseCategory.ShoulderPress, ShoulderPressExerciseName.ArnoldPress) },
/* Arm Circles */ { "1b3400e0aade45e58d2f42cf19af0f40", new (ExerciseCategory.WarmUp, WarmUpExerciseName.ArmCircles) },

// B
/* Bear Crawl */ { "46112d47abe24b53ad1fa8e75edcf545", new (ExerciseCategory.Plank, PlankExerciseName.BearCrawl) },
Expand All @@ -39,6 +41,7 @@ public static class ExerciseMapping
/* Clam Shell */ { "5749daaf9be3448397af9d813d760ff3", new (ExerciseCategory.HipRaise, HipRaiseExerciseName.Clams) },
/* Clean */ { "f2a28d3ebf3c4844a704d2b94e283099", new (ExerciseCategory.OlympicLift, OlympicLiftExerciseName.DumbbellClean) },
/* Concentrated Curl */ { "3695ef0ec2ce484faedc8ce2bfa2819d", new (ExerciseCategory.Curl, CurlExerciseName.SeatedDumbbellBicepsCurl) },
/* Criss-Cross */ { "b62c0d2189ae4c2fb6f5203fa145010a", new (ExerciseCategory.Core, CoreExerciseName.CrissCross) },
/* Crunch */ { "61ac0d64602c48fba25af7e5e5dc1f97", new (ExerciseCategory.Crunch, CrunchExerciseName.Crunch) },
/* Cursh Press */ { "4899db2664ce47da8ec14282282d3b0d", new (ExerciseCategory.BenchPress, BenchPressExerciseName.CloseGripBarbellBenchPress) },
/* Cross Body Curl */ { "a66b797fc2014b799cc0cb114d9c5079", new (ExerciseCategory.Curl, CurlExerciseName.CrossBodyDumbbellHammerCurl) },
Expand Down Expand Up @@ -70,6 +73,7 @@ public static class ExerciseMapping
// H
/* Hammer Curl */ { "114ce849b47a4fabbaad961188bf4f7d", new (ExerciseCategory.Curl, CurlExerciseName.DumbbellHammerCurl) },
/* High Plank */ { "194cc4f6a88c4abd80afe9bbddb25915", new (ExerciseCategory.Plank, PlankExerciseName.StraightArmPlank) },
/* High Pull */ { "d06c8e68481741de849e4101eda76855", new (ExerciseCategory.Shrug, ShrugExerciseName.DumbbellUprightRow) },
/* High Side Plank */ { "a6833a0f9c35489585398d1f293600de", new (ExerciseCategory.Plank, PlankExerciseName.SidePlank) },
/* Hip Bridge */ { "06a504988ace45faabd927af1479f454", new (ExerciseCategory.HipRaise, HipRaiseExerciseName.BarbellHipThrustOnFloor) },
/* Hollow Hold */ { "060174b84e3744e6a19fe4ce80411113", new (ExerciseCategory.Crunch, CrunchExerciseName.HollowRock) },
Expand All @@ -85,7 +89,8 @@ public static class ExerciseMapping
/* Neutral Grip Chest Press */ { "802f10996b5048d08f320d8661f13ee1", new (ExerciseCategory.BenchPress, BenchPressExerciseName.NeutralGripDumbbellBenchPress) },

// O
/* Open Lateral Raise */ { " 00046ee377554425866b0a1963b98589", new (ExerciseCategory.LateralRaise, LateralRaiseExerciseName.SeatedLateralRaise) },
/* Oblique Heel Tap */ { "d5ec25fe793f4318a6891607bd3c9259", new (ExerciseCategory.Crunch, CoreExerciseName.SideBend) },
/* Open Lateral Raise */ { "00046ee377554425866b0a1963b98589", new (ExerciseCategory.LateralRaise, LateralRaiseExerciseName.SeatedLateralRaise) },
/* Overhead Carry */ { "12057d5f9e144913a824bcae5706966c", new (ExerciseCategory.Carry, CarryExerciseName.OverheadCarry) },
/* Overhead Extension */ { "f260623343e74d37b165071ee5903199", new (ExerciseCategory.TricepsExtension, TricepsExtensionExerciseName.OverheadDumbbellTricepsExtension) },
/* Overhead Press */ { "ef0279948228409298cd6bf62c5b122c", new (ExerciseCategory.ShoulderPress, ShoulderPressExerciseName.OverheadDumbbellPress) },
Expand All @@ -102,13 +107,15 @@ public static class ExerciseMapping
/* Reverse Fly */ { "3df6a1136a7a4e4db31e104c7d5a0fcf", new (ExerciseCategory.Flye, FlyeExerciseName.InclineDumbbellFlye) },
/* Renegade Row */ { "ed9adea36e77459dab7c189884ceb7ab", new (ExerciseCategory.Row, RowExerciseName.RenegadeRow) },
/* Roll Up */ { "0b853e45afb04c31968b20fc7deaa718", new (ExerciseCategory.Core, CoreExerciseName.RollUp) },
/* Row */ { "165ed4b439204800b9d88d85363f0609", new (ExerciseCategory.Row, RowExerciseName.DumbbellRow) },
/* Romanian Deadlift */ { "a17b8d35d1264a2fbabe3ab28df458dc", new (ExerciseCategory.Deadlift, DeadliftExerciseName.DumbbellDeadlift) },// RDL exists in Connect but not in SDK definition
/* Russian Twist */ { "5c7b2bc65abc4c44849e2119f1338120", new (ExerciseCategory.Core, CoreExerciseName.RussianTwist) },

// S
/* Scissor Kick */ { "f6a10df381004afba2a2b63447d9968f", new (ExerciseCategory.Crunch, CrunchExerciseName.LegLevers) },
/* Scissors */ { "0f9b2d6f18b247bd950d60bbbefd19f3", new (ExerciseCategory.Crunch, CrunchExerciseName.LegLevers) },
/* Shoulder Tap */ { "5b33283433e7479390c0d5fc11722f80", new (ExerciseCategory.Plank, PlankExerciseName.StraightArmPlankWithShoulderTouch) },
/* Single Leg Stretch */ { "32c3f3f1f90446ad8e58589b45ae891b", new (ExerciseCategory.Core, CoreExerciseName.SingleLegStretch) },
/* Skull Crusher */ { "3c72e60de73d43f4b5a774c90dea90cd", new (ExerciseCategory.TricepsExtension, TricepsExtensionExerciseName.DumbbellLyingTricepsExtension) },
/* Snatch */ { "0ddf8f94acfe4c2289aef5a9bf59e8d9", new (ExerciseCategory.OlympicLift, OlympicLiftExerciseName.SingleArmDumbbellSnatch) },
/* Split Squat */ { "28833fd99466476ea273d6b94747e3db", new (ExerciseCategory.Squat, SquatExerciseName.DumbbellSplitSquat) },
Expand All @@ -119,6 +126,7 @@ public static class ExerciseMapping
// T
/* Table Top Lateral Leg Lift */ { "5bb2d37f052e4d2faf1b0f1de4489531", new (ExerciseCategory.Plank, PlankExerciseName.KneelingSidePlankWithLegLift) },
/* Tall Kneeling Side Bend */ { "6be91da1de1c49f4b34bf358bdbf3bbc", new (ExerciseCategory.Crunch, CrunchExerciseName.StandingSideCrunch) },
/* Tricep Dip */ { "0a983b7dfca7400a92761380ff9d351a", new (ExerciseCategory.TricepsExtension, TricepsExtensionExerciseName.BodyWeightDip) },
/* Tricep Kickback */ { "da89d743904640d58e8b3f667f08783c", new (ExerciseCategory.TricepsExtension, TricepsExtensionExerciseName.DumbbellKickback) },
/* Tuck up */ { "3069e7ba28b84005b71c16a3781dda8d", new (ExerciseCategory.SitUp, SitUpExerciseName.BentKneeVUp) },
/* Tricep Push Up */ { "d463a4dc0cf640e0a58f3aa058c5b1a0", new (ExerciseCategory.PushUp, PushUpExerciseName.PushUp) },
Expand Down
6 changes: 5 additions & 1 deletion src/Garmin/Auth/GarminAuthenticationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ public class GarminAuthenticationService : IGarminAuthenticationService
{
id = "gauth-widget",
embedWidget = "true",
gauthHost = "https://sso.garmin.com/sso"
gauthHost = "https://sso.garmin.com/sso/embed",
redirectAfterAccountCreationUrl = "https://sso.garmin.com/sso/embed",
redirectAfterAccountLoginUrl = "https://sso.garmin.com/sso/embed",
service = "https://sso.garmin.com/sso/embed",
source = "https://sso.garmin.com/sso/embed",
};

private readonly ISettingsService _settingsService;
Expand Down
2 changes: 2 additions & 0 deletions vNextReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
- [#495] Open Lateral Raise, Pike Push Up, Dolphin
- [#499] Forearm Side Plank Rotation, Straight Leg Bicycle
- [#510] Bear Crawl
- [#546] Arm Circles, Criss-Cross, High Pull, Oblique Heel Tap, Row, Single Leg Stretch, Tricep Dip
- [#532] GitHubAction now supports attaching output files to the GitHub Action as a zip file you can download - @anlesk

## Fixes

- [#526] `Auth appeared successful but there was an error sending the service ticket to Garmin`
- [#541] Continuation of #526 but specifically for the MFA flow
- `All converters were skipped.` - confusing log message when no workouts needed to be synced

## Housekeeping
Expand Down

0 comments on commit 1808577

Please sign in to comment.