-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #386: Add support for local caching of audio & image assets #399
Conversation
This change ensures that completed progress is consistent and correct everywhere for fractions and ratios topics. It also ensures that there are thumbnails defined for chapters, and that all thumbnails are consistent regardless of which screen topics, stories, or chapters are viewed from. It updates the reported lesson count to be correct.
caching for audio files.
This is blocked on #393. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont have much context on how it should work but code wise LGTM!
domain/src/main/java/org/oppia/domain/exploration/ExplorationRetriever.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good implementation! I need to do a deeper look at AssetRepository to understand all functionality but in general LGTM.
Conflicts: domain/src/main/java/org/oppia/domain/topic/TopicController.kt
…realistic-download-size
Conflicts: domain/src/main/java/org/oppia/domain/topic/TopicController.kt
…repo Conflicts: utility/src/main/java/org/oppia/util/parser/UrlImageParser.kt
Conflicts: domain/src/main/java/org/oppia/domain/topic/TopicController.kt
Thanks! |
Fix #386.
This PR introduces an AssetRepository that supports caching both JSON and and binary assets (for images and audio files). The repository caches JSON files in memory for faster retrieval, and caches binary files in the app's cache directory.
This PR also updates TopicListController to prime the repository with audio and image files from the 'meaning of equal parts' lesson. This will download all binary assets corresponding to that exploration upon opening the app. This takes a few minutes depending on the device's connection strength and consumes about ~80mb of cache space.
By default, the binary asset caching is disabled using a Dagger flag.
This PR does not introduce any tests because this local caching behavior is temporary until #169 is completed.