openedx / openedx-app-ios

The mobile app for iOS for the Open EdX Platform.
Apache License 2.0
19 stars 13 forks source link

feat: Delete old downloaded videos data on device to optimize storage #452

Closed shafqat-muneer closed 2 weeks ago

shafqat-muneer commented 2 weeks ago

LEARNER-9966: Delete old downloaded videos data on device to optimize storage

We decided not to migrate downloaded content but have to look into deleting the old downloaded videos so the app does not create useless dummy data in the learners' devices.

Technical Details: The old application saves users' downloaded videos in the Application Support directory within folders named users' MD5 hashes. When multiple users log into the same device, separate MD5 hashed folders are created for each user, each containing that user's downloaded data.

After upgrading the application, we can use the MD5 hash algorithm to delete only the data of the currently logged-in user, while the data for other users will remain intact. Because MD5 hash folder name will be generated for current logged in username. To prevent this scenario, we need to create a regex that identifies and deletes all MD5 hashed folders upon launching the upgraded application.

We can consider removing this code once we are confident that most or all users have transitioned to the new application.

Before Update Size After Update Size
Before Update Size After Update Size
Before Update After Update
shafqat-muneer commented 2 weeks ago

@saeedbashir @rnr Addressed suggestions. Ready for another round of review 🎉

shafqat-muneer commented 2 weeks ago

@volodymyr-chekyrta Awaiting your review. Thanks