Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhotoListView is ordered by modified date instead of creation date #882

Open
8nich opened this issue Sep 2, 2022 · 3 comments
Open

PhotoListView is ordered by modified date instead of creation date #882

8nich opened this issue Sep 2, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@8nich
Copy link

8nich commented Sep 2, 2022

The PhotoListView should be ordered by the "Date Picture Taken" not by "lastModifiedAt". Otherwise the timeline gets mixed up.

I had this issue with an iphone. When I did a sync with kDrive from a date in the past it happened that some picture had not the same date for "Date Picture Taken" v.s. "lastModifiedAt" and were therefore wrongly displayed in the timeline. That's why I stumbled upon this.

Does this behaviour maybe have to do with this code part (I am not an experienced coder):

newSections.append(Section(model: Group(referenceDate: picture.lastModifiedAt, sortMode: sortMode), elements: []))

@JorisBodin
Copy link
Member

Hello @8nich,

The created_at of a file can be null, unlike the last_modified_at which is mandatory. (if a file is uploaded with the browser for example we do not have the date of creation and some applications that create files do not inform this date either)
So we can't sort by creation date.

To shoot by "Date Picture Taken", the api has to extract the EXIF of all the pictures of a drive. What is currently not the case. But we think about it.

@JorisBodin JorisBodin added the enhancement New feature or request label Sep 5, 2022
@8nich
Copy link
Author

8nich commented Sep 5, 2022

Thanks @JorisBodin for your quick reply.
Yes you are right, the best approach is to extract the "Date Picture Taken" out of the EXIF. I think in the android App you already do that:
https://github.com/Infomaniak/android-kDrive/blob/8194456117ca1cadb631aca469f9c14d110fba6c/app/src/main/java/com/infomaniak/drive/utils/SyncUtils.kt#L57
But also there you order by "fileModifiedAt".
Would be great, if you could implement this change.

@JorisBodin
Copy link
Member

The fileCreatedAt shown on the link can also be null, it's not mandatory information. And it is not retrieved from the EXIF, but from the MediaStore of android.
And it wouldn't change the fact that if the file was uploaded from the webapp, browsers don't communicate the creation date of a file.

So we can't sort by creation date because it can be null.

A solution that could be considered is to put the modification date of a file as creation date if it is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants