Skip to content

Commit

Permalink
Merge pull request #2125 from nextcloud/artonge/sort_by_taken_date
Browse files Browse the repository at this point in the history
Use original date time to order files in UI
  • Loading branch information
artonge authored Nov 13, 2023
2 parents 951daca + 7a2c013 commit 2340fc3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Listener/OriginalDateTimeMetadataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function handle(Event $event): void {
return;
}

if (!in_array($node->getMimeType(), Application::IMAGE_MIMES)) {
if (!in_array($node->getMimeType(), Application::IMAGE_MIMES) && !in_array($node->getMimeType(), Application::VIDEO_MIMES)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const mutations = {
file.fileid = file.fileid.toString()

// Precalculate dates as it is expensive.
const date = moment(file.lastmod)
const date = moment((file.metadataPhotosOriginalDateTime * 1000) || file.lastmod)
file.timestamp = date.unix() // For sorting
file.month = date.format('YYYYMM') // For grouping by month
file.day = date.format('MMDD') // For On this day
Expand Down

0 comments on commit 2340fc3

Please sign in to comment.