issues
search
leonlatsch
/
Photok
Encrypted Photo Safe for Android
Apache License 2.0
430
stars
45
forks
source link
Include Albums in Backups
#301
Closed
leonlatsch
closed
1 month ago
leonlatsch
commented
1 month ago
Currently albums are not included in backups.
Add albums to backups
Add photo refs to albums to backups
Refactor backup code to handle all backup versions
leonlatsch
commented
1 month ago
Flow
Creating a backup
Open a zip file at desired location
Move all internal files (photos, thumbnails, video previews) into zip file as they are
Load all Photos, Albums and AlbumPhoto Refs from database
Write all of them into meta.json into zip file
Restoring a backup
Verify backup
Open the zip file
Check for meta.json and load it
count internal files ending with .photok and check if they match the photos inside meta.json
Check that backup version is supported
Restore
Version 1
For each photo:
Copy .photok file to internal storage (read with orig password)
Create a new thumbnail from .photok file
Insert photo into database
Version 2
Copy all files in zip except meta.json to internal storage (read with orig password)
Insert all photos from meta.json into database
Version 3
Copy all files in zip except meta.json to internal storage (read with orig password)
Insert all photos from meta.json into database
Insert all albums from meta.json into database
Insert all refs from meta.json into database
Currently albums are not included in backups.