Git Product home page Git Product logo

Comments (5)

alex-hhh avatar alex-hhh commented on June 15, 2024

(Sorry, I closed this by clicking the wrong button, reopening it)

Can you share that activity, so I can have a look? Either attach it to this issue, or send it to me directly at [email protected]. I have a large collection of "odd" FIT files for testing, but it seems that there is always a new one, which breaks...

Also, does this activity contain data collected using a "Connect IQ" application? (support for these is new).

from activitylog2.

airon111 avatar airon111 commented on June 15, 2024

Yes the activity contains data from a connect iq data field...it is a multi data field in one page using stock data field showed...and the Garmin connect iq power field.

All my activities since years have this kind of data because I use this all in one data field .

In fact I tried to import also other activities and none worked..
( Sorry I closed also by mistake clicking in phone...reopened)

from activitylog2.

alex-hhh avatar alex-hhh commented on June 15, 2024

The patch below will avoid inserting the multi-value field in the database, and the activity will import correctly (without that field being added). You will still be able to see the running power data.

I will push a fix later today (I want to do some more testing), but meanwhile, you can apply the patch below, by saving it to a file (make sure you use UNIX line endings) and using "git apply". A;ternatively, you can open the "rkt/database.rkt" file in a text editor, find the xdata-store-values and xdata-store-summary-values functions and replace the "(when val" lines with "(when (and val (or (number? val) (string? val) (bytes? val)))".

Also, how does Garmin Connect display this field in its GUI? I am not sure there is enough information in the FIT file itself to display it properly...

 rkt/database.rkt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rkt/database.rkt b/rkt/database.rkt
index 154ceea..157bb46 100644
--- a/rkt/database.rkt
+++ b/rkt/database.rkt
@@ -364,7 +364,7 @@
 (define (xdata-store-values db record id xdata-fields)
   (for (([field-key field-id] (in-hash xdata-fields)))
     (define val (dict-ref record field-key #f))
-    (when val
+    (when (and val (or (number? val) (string? val) (bytes? val)))
       (query-exec db sql-insert-xdata-value id field-id val))))
 
 (define sql-insert-xdata-summary-value
@@ -379,7 +379,7 @@
 (define (xdata-store-summary-values db record id xdata-fields)
   (for (([field-key field-id] (in-hash xdata-fields)))
     (define val (dict-ref record field-key #f))
-    (when val
+    (when (and val (or (number? val) (string? val) (bytes? val)))
       (query-exec db sql-insert-xdata-summary-value id field-id val))))

from activitylog2.

alex-hhh avatar alex-hhh commented on June 15, 2024

Hi @airon111 , I updated the master branch with a fix for this issue. Can you please fetch the latest sources, rebuild the application and try to import again? Thanks, Alex.

from activitylog2.

airon111 avatar airon111 commented on June 15, 2024

Pulled latest sources and tried it, working perfectly...
Thank you very much

from activitylog2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.