From 93ee281eeeb60ac405f4539aff40ed2cacc10ec1 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 8 May 2023 21:33:38 -0700 Subject: [PATCH] tq: add fake etag --- .../main/java/gallery/memories/service/TimelineQuery.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/gallery/memories/service/TimelineQuery.java b/app/src/main/java/gallery/memories/service/TimelineQuery.java index decc7f13..0ab148cb 100644 --- a/app/src/main/java/gallery/memories/service/TimelineQuery.java +++ b/app/src/main/java/gallery/memories/service/TimelineQuery.java @@ -67,6 +67,7 @@ public class TimelineQuery { MediaStore.Images.Media.HEIGHT, MediaStore.Images.Media.WIDTH, MediaStore.Images.Media.SIZE, + MediaStore.Images.Media.DATE_MODIFIED, }; // Filter for given day @@ -89,6 +90,7 @@ public class TimelineQuery { int heightColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.HEIGHT); int widthColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.WIDTH); int sizeColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.SIZE); + int dateModifiedColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_MODIFIED); while (cursor.moveToNext()) { long id = cursor.getLong(idColumn); @@ -98,6 +100,7 @@ public class TimelineQuery { long width = cursor.getLong(widthColumn); long size = cursor.getLong(sizeColumn); long dateTaken = datesTaken.get(id); + Long dateModified = cursor.getLong(dateModifiedColumn); // Remove from list of ids imageIds.remove(id); @@ -111,7 +114,8 @@ public class TimelineQuery { .put("datetaken", dateTaken) .put("h", height) .put("w", width) - .put("size", size); + .put("size", size) + .put("etag", dateModified.toString()); files.add(file); } catch (JSONException e) { Log.e(TAG, "JSON error");