Device Backup: Fix VLC directory hiding in Files app + Exclude Media Library database
Why ? On iOS 11+, if we exclude Documents directory from backup, Files.app might hide VLC's folder.
Solution : apply isExcludedFromBackup
recursively when the user changes the Backup media library setting.
Problem : depending on the device and the quantity of files, this can be really slow.
Solution : adopt strategies that speed up the process of exclusion
- On iOS 9 / 10 (usually old and slow devices), Files.app does not exist so we exclude Documents as before. One action, fast.
- On iOS 11+, we exclude the first level of files in Documents but not Documents itself. Files.app won't hide VLC but this will limit the amount of actions.
However, as older versions of VLC excluded the library on a per-file basis, these strategies can only be applied to exclusion.
Inclusion must be applied recursively to every files, to be sure that after an update, no file are left excluded.
On file add :
- Exclude or include any added file according to the Backup media library setting
On setting change :
Exclude from backup | Include in backup | |
---|---|---|
iOS 11+ | Exclude Documents' top level files | Include recursively the Documents directory |
iOS 9 / 10 | Exclude Documents directory | Include recursively the Documents directory |
On app start :
Updating from the previous version | Updating from an older version | |
---|---|---|
on iOS 11+, excluded from backup | reinclude Documents and exclude top-level files in Documents | do nothing |
on iOS 11+, included in backup | reinclude Documents and its content recursively | reinclude Documents' content recursively |
on iOS 9 / 10, excluded from backup | do nothing | exclude Documents |
on iOS 9 / 10, included in backup | reinclude Documents and its content recursively | reinclude Documents' content recursively |
Edited by Edgar Fouillet