diff --git a/Directory.Build.props b/Directory.Build.props index 683287d..5acaee2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,8 +9,8 @@ disable latest - 5.10.0 - 50 + 5.10.1 + 51 FitEdit EnduraByte LLC 2024 diff --git a/Infrastructure/FitEdit.Adapters.Fit/Decode.cs b/Infrastructure/FitEdit.Adapters.Fit/Decode.cs index e9de169..0805a28 100644 --- a/Infrastructure/FitEdit.Adapters.Fit/Decode.cs +++ b/Infrastructure/FitEdit.Adapters.Fit/Decode.cs @@ -415,7 +415,7 @@ private void ReadDataMesg(Stream fitStream, BinaryReader br, long sourceIndex, b if (timeTraveled) { - var dt = new RecordMesg(mesg).GetTimestamp().GetDateTime(); + var dt = new RecordMesg(mesg).GetTimestamp()?.GetDateTime(); Log.Warn($"Discarding suspicious message at {dt} with timestamp change of {diff}s"); Log.Debug($"Source data: {string.Join(" ", mesg.SourceData?.Select(b => $"{b:X2}") ?? new List())}"); return; diff --git a/Infrastructure/FitEdit.Adapters.Fit/FitConfig.cs b/Infrastructure/FitEdit.Adapters.Fit/FitConfig.cs index 47b2687..a2dfc86 100644 --- a/Infrastructure/FitEdit.Adapters.Fit/FitConfig.cs +++ b/Infrastructure/FitEdit.Adapters.Fit/FitConfig.cs @@ -22,7 +22,7 @@ public class DataMessages public static bool OfLargeSize { get; set; } = false; public static bool WithLargeLatitudeChange { get; set; } = true; public static bool WithLargeLongitudeChange { get; set; } = true; - public static bool WithLargeTimestampChange { get; set; } = true; + public static bool WithLargeTimestampChange { get; set; } = false; /// /// Ignore any FileId message other than the first or any FileId message that is not at the beginning of the file. diff --git a/Infrastructure/FitEdit.Data/Fit/FitFileExtensions.cs b/Infrastructure/FitEdit.Data/Fit/FitFileExtensions.cs index 1e6126a..3bfbfc3 100644 --- a/Infrastructure/FitEdit.Data/Fit/FitFileExtensions.cs +++ b/Infrastructure/FitEdit.Data/Fit/FitFileExtensions.cs @@ -358,15 +358,13 @@ public static FitFile ApplySpeeds(this FitFile fitFile, Dictionary l merged.Append(file); } - var activityMesg = merged.FindFirst(); - DateTime firstActivityTime = activityMesg?.GetTimestamp().GetDateTime() ?? default; - + merged.BackfillEvents(); + merged.RemoveNonfirst(typeof(FileIdMesg)); merged.RemoveNonfirst(typeof(FileCreatorMesg)); merged.RemoveNonfirst(typeof(DeviceSettingsMesg)); merged.RemoveNonfirst(typeof(UserProfileMesg)); merged.RemoveNonfirst(typeof(ActivityMesg)); - merged.RemoveAll(typeof(DeviceInfoMesg), after: firstActivityTime); return merged; } diff --git a/Ui/FitEdit.Ui.iOS/Info.plist b/Ui/FitEdit.Ui.iOS/Info.plist index ea3a4ad..a2107b0 100644 --- a/Ui/FitEdit.Ui.iOS/Info.plist +++ b/Ui/FitEdit.Ui.iOS/Info.plist @@ -57,6 +57,6 @@ CFBundleVersion - 50 + 51 \ No newline at end of file