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

Criteria to sort pictures/videos #1424

Closed
darguez opened this issue Oct 25, 2022 · 6 comments
Closed

Criteria to sort pictures/videos #1424

darguez opened this issue Oct 25, 2022 · 6 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. enhancement New feature or request

Comments

@darguez
Copy link

darguez commented Oct 25, 2022

I know this topic is not new, but it is still not clear to me what is the criteria for sorting the photos / videos.

The following are real situations with different criteria:

  1. Photos/videos are always taken with devices that store the files as YYYYMMDD-HHMMSS.jpg --> Filename is goot to sort
  2. Photos/videos are stored in nextcloud as they are taken --> Creation date is good to sort
  3. Photos/videos are stored in nextcloud when wifi is available, some uploads fails and need retries, photos/videos are not stored in nextcloud in the order they were taken. --> Date taken/recorded is good to sort
  4. Photos/videos are uploaded manually not in the order they were taken --> Date taken/recorded is good to sort

I know sort by date taken/recorded implies to manage exif data and maybe this option is not available. But in those cases the photos are not correctly displayed by default, the user should have some alternative:

  • Rename files to assure they are in the correct order
  • Change file date to allow sorting by desired date. The problem here is that generally it is not possible to change the creation date but the modified date. And if the app only allows sorting by creation date there is nothing the user can do to fix the order.

In conclusion, there are different scenarios that require different criteria, but it seems at least one alternative (sort by name or sort by modified date) should be available to fix sorting by creation date when it doesn't provide the expected results.

Finally, just to mention that the order from newest to oldest instead oldest to newest has a negative impact in slideshow, because you are forced to see the photos in reserve order.

@darguez darguez added 0. Needs triage Pending approval or rejection. This issue is pending approval. enhancement New feature or request labels Oct 25, 2022
@darguez
Copy link
Author

darguez commented Oct 27, 2022

BTW I discovered that after executing this script: https://github.com/darguez/media-sorting and re-scan the corresponding directories, I can get the Album sorted from oldest to newest by adding the line:
->orderBy('mtime','ASC') in getForAlbumIdAndUserWithFiles() function in photos/lib/Album/AlbumMapper.php file

@jtrees
Copy link

jtrees commented Nov 24, 2022

BTW I discovered that after executing this script: https://github.com/darguez/media-sorting and re-scan the corresponding directories, I can get the Album sorted from oldest to newest by adding the line: ->orderBy('mtime','ASC') in getForAlbumIdAndUserWithFiles() function in photos/lib/Album/AlbumMapper.php file

This is a horrible workaround... but incredibly useful. Thanks for sharing!

@paulvt
Copy link

paulvt commented Nov 26, 2022

Useful indeed! It unfortunately does not seem to work when using the public link to view the albums, so the sorting is not applied everywhere but could not find where it is missing.

@darguez
Copy link
Author

darguez commented Nov 26, 2022

Other functions where you can add ->orderBy('mtime','ASC') in photos/lib/Album/AlbumMapper.php file:

  • getForAlbumIdAndUserWithFiles() <-- the one mentioned above
  • getForAlbumIdAndFileId()
  • getSharedAlbumsForCollaboratorWithFiles()

I guess the last one is a good candidate to get the right order in albums viewed with public link.

@joshtrichards
Copy link
Member

Hi @darguez - This topic is already being tracked in #87 and #397. Please close out this Issue to avoid confusion / duplicate work (unless you have a good reason to keep it separate that I'm overlooking).

@darguez
Copy link
Author

darguez commented Jul 1, 2023

ok, thanks for contributing to solve this issue!

@darguez darguez closed this as completed Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants