From 2bcb954266a08699586d724a8593b9f1f95250f3 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 13 Jul 2020 16:29:36 +0200 Subject: [PATCH] Show taken date incl source in photo info tab #396 Signed-off-by: Michael Mayer --- frontend/src/dialog/photo/files.vue | 2 +- frontend/src/dialog/photo/info.vue | 38 +++++++++++++++++------------ pkg/txt/convert_test.go | 6 +++++ 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/frontend/src/dialog/photo/files.vue b/frontend/src/dialog/photo/files.vue index 47464d9eb..71f93938e 100644 --- a/frontend/src/dialog/photo/files.vue +++ b/frontend/src/dialog/photo/files.vue @@ -66,7 +66,7 @@ Folder - {{ file.Root }} + {{ file.Root | capitalize }} diff --git a/frontend/src/dialog/photo/info.vue b/frontend/src/dialog/photo/info.vue index 83d4fc388..1bacf0233 100644 --- a/frontend/src/dialog/photo/info.vue +++ b/frontend/src/dialog/photo/info.vue @@ -13,25 +13,25 @@ - Type + Type {{ model.Type | capitalize }} - Folder + Folder {{ model.Path }} - Name + Name {{ model.Name }} - Original Name + Original Name - Title + Title {{ model.Title }} - Title Source + Title Source {{ model.TitleSrc | capitalize }} - Quality Score + Taken + + {{ model.getDateString() }} ({{ model.TakenSrc | capitalize }}) + + + + Quality Score @@ -64,20 +70,20 @@ - Resolution + Resolution {{ model.Resolution }} MP - Camera Serial + Camera Serial {{ model.CameraSerial }} - Favorite + Favorite - Private + Private - Created + Created {{ formatTime(model.CreatedAt) }} @@ -163,7 +169,7 @@ - Updated + Updated {{ formatTime(model.UpdatedAt) }} @@ -171,7 +177,7 @@ - Edited + Edited {{ formatTime(model.EditedAt) }} @@ -179,7 +185,7 @@ - Checked + Checked {{ formatTime(model.CheckedAt) }} @@ -187,7 +193,7 @@ - Archived + Archived {{ formatTime(model.DeletedAt) }} diff --git a/pkg/txt/convert_test.go b/pkg/txt/convert_test.go index f33792f23..0863eb2aa 100644 --- a/pkg/txt/convert_test.go +++ b/pkg/txt/convert_test.go @@ -7,6 +7,12 @@ import ( ) func TestTime(t *testing.T) { + t.Run("2018/04 - April/2018-04-12 19:24:49.gif", func(t *testing.T) { + result := Time("2018/04 - April/2018-04-12 19:24:49.gif") + assert.False(t, result.IsZero()) + assert.Equal(t, "2018-04-12 19:24:49 +0000 UTC", result.String()) + }) + t.Run("/2020/1212/20130518_142022_3D657EBD.jpg", func(t *testing.T) { result := Time("/2020/1212/20130518_142022_3D657EBD.jpg") //assert.False(t, result.IsZero())