photonix icon indicating copy to clipboard operation
photonix copied to clipboard

Mobile app image uploading

Open damianmoore opened this issue 3 years ago • 0 comments

In the mobile app there will be 2 new screens accessible from the left navigation draw: "Uploads" and "Upload logs".

These are the mockups of the new screens: layout

If user deletes auto-uploaded photo from library it should not be deleted from the device and should not be re-uploaded

There will need to be a data structure stored on the device in the following format. This will let us check if a file have been uploaded if we have a path or a md5sum. We want to check by both of these when we detect a photo so we can see if it has already been uploaded (even if it was just moved to a different folder).

files = {
  123456ab-cdef-1234-56ab-cdef123456ab: { // Library.id
    paths: {
      /mnt/emulated/0/DCIM/0123.jpg: { // File path on device
        md5sum: "123456abcdef123456abcdef123456ab",
        uploaded: true,
      },
    },
    md5sums: {
      "123456abcdef123456abcdef123456ab": "/mnt/emulated/0/DCIM/0123.jpg",
    }
  }
}

We should also keep another structure to log uploads that have happened or attempted. This will show in reverse order (newest at the top) on the "Upload log" screen. When the list gets over 100 items long, remove the oldest.

uploads = [
  {
    date: "2021-01-01T00:00:00",
    path: "/mnt/emulated/0/DCIM/0123.jpg",
    status: "SUCCESS", // or "FAIL"
  }
]

damianmoore avatar Apr 18 '21 16:04 damianmoore