Closed deniger closed 3 years ago
I'd like to work on the issue. Can you please more in detail about the issue and expected changes to be done.
in openfoodfacts.github.scrachx.openfood.views.splash.SplashPresenter#refreshData we specify what should be downloaded or not.
But in LoadTaxonomiesService#doTask we use a if/elseif to filter what should be downloaded. So only the lines 48 -> 72 ( off) should be kept
In LoadTaxonomiesService#doTask the if/elseif filter is based on BuildConfig.FLAVOR while the if else in SplashPresenter.refreshData is not based on the same criteria. Correct me if am wrong.
in refreshData, we initialize settings based on BuildConfig.FLAVOR in order to activate downloads in doTask we use BuildConfig.FLAVOR to filter download and then in ProductRepository#getXXX we use the settings to perform or not the downloads...
"in refreshData, we initialize settings based on BuildConfig.FLAVOR". can you point out in the code where this is happening. I'm unable to find this.
and then this intialization is used in ProductRepository : https://github.com/openfoodfacts/openfoodfacts-androidapp/blob/fed0f18ffd017b047da455b6e8f50e983ae13c26/app/src/main/java/openfoodfacts/github/scrachx/openfood/repositories/ProductRepository.java#L491
@Abhisek2090 I will work on https://github.com/openfoodfacts/openfoodfacts-androidapp/pull/2871/files. A new taxonomy is downloaded and we will simplify the whole thing This issue will be closed. I propose that you review my modifications to be sure everything is ok Is it ok for you ?
@deniger .Yes, its fine with me. Will review the modifications when done. Thank you for your guidance.
openfoodfacts.github.scrachx.openfood.views.LoadTaxonomiesService#doTask this method loads labels,tags, allergens, ingredients, countries, additivces and categories according to the application
this task can be simplified as the configuration is now done in openfoodfacts.github.scrachx.openfood.views.splash.SplashPresenter#refreshData