davidhealey / waistline

Libre calorie counter app for Android. Built with Cordova.
557 stars 66 forks source link

FNDDS nutriments not all importing? #387

Closed Steve7654 closed 2 years ago

Steve7654 commented 2 years ago

Great app. No really, great app! I love open source and the ethos behind it. It's fantastic to find apps that are fully featured and well designed, and available on f-droid : ) .

I use this app to very closely track my diet as I have an auto immune disease where vitamin deficiencies are a constant battle. As I require complete and accurate data for all ingredients I nearly exclusively use the FNDDS integration as these foods have government verified and most complete nutrient entry.

However, I've noted not all data seems to get imported? I've been cross checking against MyFoodData online which searches (the same?) FNDDS database.

Using 'eggs raw' as an example, all present nutrients appear to match exactly for a 100g serve, for example the data source appears the same as cross checked nutrients such as the following match on both Waistline and MyFoodData:

Weight 100g Fat 9.58g Protein 12.6 g Cholesterol 372mg Calcium 56mg Iron 1.8g Phosphorous 198mg

BUT, other nutrients are imported as zero,or not correctly read in, for example: Vitamin B12 Selenium B9 folate

Out of curiosity I also checked waistline with high b12 foods such as whole milk and while other nutrients matched FNDDS on MyFoodData, B12 and others less common nutrients were missing. This a real challenge as B12 is often very closely monitored for those eating less red meat or animal products and accurate / complete nutrient import is important.

Any thoughts? Note, I have the switches for all nutriments set to on. Does waistline have a cap on how much nutrient data can be pulled for an item? Or is it using a less complete data set to pull from?

I know we can use OFF to input our own foods, which I do for less common ingredients, but manually importing all nutrients is about a 15min task for a single ingredient so simply not viable. Besides, the process works well with the FNDDS for those who use wholefoods and ate after a more complete data set. It just may be that it's not correctly importing?

Thanks heaps, Steve

EmilJunker commented 2 years ago

Thanks for reporting this. After some digging, I found the cause of the bug. There is a problem in the internal conversion logic (for converting between units). The API from USDA uses "ug" as unit symbol for microgram while Waistline and OFF use "µg".

Merging #389 should fix it.

Steve7654 commented 2 years ago

Thanks for the prompt reply and action EmilJunker. Can you please clarify, to get the working version of Waistline I'd need to uninstall then reinstall from F-droid. To do this, would I lose my recipes and diary entries? If I do a backup first, will that men's I don't lose anything? Thanks.

Steve7654 commented 2 years ago

When I say working version, i mean the latest version with the fix on the missing b12 (and other nutrients). Is this now incorporated in the version on f-droid?

There is no 'update' option is there? To avoid the need to uninstall and re-install. Cheers

EmilJunker commented 2 years ago

Can you please clarify, to get the working version of Waistline I'd need to uninstall then reinstall from F-droid

The fix will be available as soon as a new release is pushed (which hasn't happened yet). Check out the GitHub releases page for more information. When a new release is pushed, you will be able to update the app through f-droid, so there is no need to uninstall.

If I do a backup first, will that men's I don't lose anything?

It's definitely a good idea to create a backup from time to time. The backup includes all your recipes, diary entries and more, so you don't loose anything when you re-import the backup. Just make sure to store the backup json file in a save location as the file created by Waistline (located under /Android/media/com.waist.line/) will be deleted if you ever uninstall the app.

davidhealey commented 2 years ago

as the file created by Waistline (located under /Android/media/com.waist.line/) will be deleted if you ever uninstall the app

I thought solved that problem, no?

EmilJunker commented 2 years ago

Unfortunately not. At least on my phone, the com.waist.line folder gets deleted when I uninstall the app. So just to be safe, I recommend copying the json file to a safe location before uninstall.