Skip to content

Commit

Permalink
[302] remove deprecated settings (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
philosowaffle committed Feb 17, 2023
1 parent 71a01cb commit 873257f
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/sync_peloton_to_garmin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
{
"App": {
"OutputDirectory": "/app/output",
"EnablePolling": false,
"CloseWindowOnFinish": true
"EnablePolling": false
},
"Format": {
"Fit": true,
Expand Down
1 change: 0 additions & 1 deletion configuration.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"OutputDirectory": "./output",
"EnablePolling": true,
"PollingIntervalSeconds": 86400,
"CloseWindowOnFinish": false,
"CheckForUpdates": true
},

Expand Down
3 changes: 0 additions & 3 deletions docs/configuration/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ This section provides global settings for the P2G application.
"OutputDirectory": "./output",
"EnablePolling": true,
"PollingIntervalSeconds": 86400,
"PythonAndGUploadInstalled": true,
"CloseWindowOnFinish": false,
"CheckForUpdates": true
}
```
Expand All @@ -94,7 +92,6 @@ This section provides global settings for the P2G application.
| OutputDirectory | no | `$PWD/output` | `App > Advanced` | Where downloaded and converted files should be saved to. |
| EnablePolling | no | `true` | `App Tab` | `true` if you wish P2G to run continuously and poll Peloton for new workouts. |
| PollingIntervalSeconds | no | 86400 | `App Tab` | The polling interval in seconds determines how frequently P2G should check for new workouts. Be warned, that setting this to a frequency of hourly or less may get you flagged by Peloton as a bad actor and they may reset your password. The default is set to Daily. |
| CloseWindowOnFinish | no | `false` | none | `true` if you wish the console window to close automatically when the program finishes. Not that if you have Polling enabled the program will never 'finish' as it remains active to poll regularly. |
| CheckForUpdates | no | `true` | `App Tab` | `true` if P2G should check for updates and write a log message if a new release is available. If using the UI this message will display there as well. |

## Format Config
Expand Down
3 changes: 0 additions & 3 deletions src/Common/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ public App()
[DisplayName("Polling Interval in Seconds")]
[Description("The polling interval in seconds determines how frequently P2G should check for new workouts. Be warned, that setting this to a frequency of hourly or less may get you flagged by Peloton as a bad actor and they may reset your password.")]
public int PollingIntervalSeconds { get; set; }
[Obsolete]
public bool? PythonAndGUploadInstalled { get; set; }
public bool CloseWindowOnFinish { get; set; }
public bool CheckForUpdates { get; set; }


Expand Down
15 changes: 0 additions & 15 deletions src/Garmin/GarminUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,6 @@ public static void ValidateConfig(Settings config)
if (config.Garmin.Upload == false) return;

config.Garmin.EnsureGarminCredentialsAreProvided();

if (config.App.EnablePolling && config.Garmin.TwoStepVerificationEnabled)
throw new ArgumentException("App.EnablePolling cannot be true when Garmin.TwoStepVerificationEnabled is true.");

if (config.App.PythonAndGUploadInstalled.HasValue)
{
_logger.Warning("App.PythonAndGuploadInstalledLocally setting is deprecated and will be removed in a future release. Please swith to using Garmin.UploadStrategy config.");

if (config.Garmin.UploadStrategy == UploadStrategy.PythonAndGuploadInstalledLocally
&& config.App.PythonAndGUploadInstalled.Value == false)
{
config.Garmin.UploadStrategy = UploadStrategy.WindowsExeBundledPython;
_logger.Warning("Detected use of deprecated config App.PythonAndGuploadInstalledLocally, setting Garmin.UploadStrategy to WindowsExeBundledPython=1");
}
}
}
}
}
8 changes: 2 additions & 6 deletions src/PelotonToGarminConsole/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ protected override async Task ExecuteAsync(CancellationToken cancelToken)
{
_logger.Error(ex, "Exception during config validation. Please modify your configuration.local.json and relaunch the application.");
Health.Set(HealthStatus.Dead);
if (!settings.App.CloseWindowOnFinish)
Console.ReadLine();
Console.ReadLine();
Environment.Exit(-1);
}

Expand Down Expand Up @@ -181,10 +180,7 @@ private async Task RunAsync(CancellationToken cancelToken)
finally
{
_logger.Verbose("Exit.");

if (!settings.App.CloseWindowOnFinish)
Console.ReadLine();

Console.ReadLine();
Environment.Exit(exitCode);
}
}
Expand Down
3 changes: 3 additions & 0 deletions vNextReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@

- [#421] Uplift to dotnet 7

## Changes

- [#302] Removed deprecated settings `PythonAndGUploadInstalled` and `CloseWindowOnFinish`

0 comments on commit 873257f

Please sign in to comment.