diff --git a/internal/api/file_test.go b/internal/api/file_test.go index 5516d94c1..2c8a74404 100644 --- a/internal/api/file_test.go +++ b/internal/api/file_test.go @@ -17,7 +17,7 @@ func TestGetFile(t *testing.T) { assert.Equal(t, http.StatusOK, r.Code) val := gjson.Get(r.Body.String(), "Name") - assert.Equal(t, "2020/07/exampleFileName.jpg", val.String()) + assert.Equal(t, "2790/07/27900704_070228_D6D51B6C.jpg", val.String()) }) t.Run("search for not existing file", func(t *testing.T) { app, router, _ := NewApiTest() diff --git a/internal/api/photo_test.go b/internal/api/photo_test.go index 2626cc760..536e9ef04 100644 --- a/internal/api/photo_test.go +++ b/internal/api/photo_test.go @@ -15,8 +15,8 @@ func TestGetPhoto(t *testing.T) { GetPhoto(router) r := PerformRequest(app, "GET", "/api/v1/photos/pt9jtdre2lvl0yh7") assert.Equal(t, http.StatusOK, r.Code) - val := gjson.Get(r.Body.String(), "Lat") - assert.Equal(t, "48.519234", val.String()) + val := gjson.Get(r.Body.String(), "Iso") + assert.Equal(t, "200", val.String()) }) t.Run("search for not existing photo", func(t *testing.T) { diff --git a/internal/entity/file_fixtures.go b/internal/entity/file_fixtures.go index 5cd9fac9c..69a9d371d 100644 --- a/internal/entity/file_fixtures.go +++ b/internal/entity/file_fixtures.go @@ -12,7 +12,7 @@ var FileFixtures = map[string]File{ PhotoUID: PhotoFixtures.Pointer("19800101_000002_D640C559").PhotoUID, InstanceID: "a698ac56-6e7e-42b9-9c3e-a79ec96087uy", FileUID: "ft8es39w45bnlqdw", - FileName: "2020/07/exampleFileName.jpg", + FileName: "2790/07/27900704_070228_D6D51B6C.jpg", FileRoot: RootOriginals, OriginalName: "Vacation/exampleFileNameOriginal.jpg", FileHash: "2cad9168fa6acc5c5c2965ddf6ec465ca42fd818", @@ -43,9 +43,9 @@ var FileFixtures = map[string]File{ FileShareFixtures.Get("FileShare2", 0, 0, ""), }, Sync: []FileSync{}, - CreatedAt: time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC), + CreatedAt: time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC), CreatedIn: 414671279, - UpdatedAt: time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC), + UpdatedAt: time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC), UpdatedIn: 847648638, DeletedAt: nil, }, diff --git a/internal/entity/photo_fixtures_test.go b/internal/entity/photo_fixtures_test.go index 9b28446a4..4859a7f95 100644 --- a/internal/entity/photo_fixtures_test.go +++ b/internal/entity/photo_fixtures_test.go @@ -10,7 +10,7 @@ func TestPhotoMap_Get(t *testing.T) { t.Run("get existing photo", func(t *testing.T) { r := PhotoFixtures.Get("19800101_000002_D640C559") assert.Equal(t, "pt9jtdre2lvl0yh7", r.PhotoUID) - assert.Equal(t, "19800101_000002_D640C559", r.PhotoName) + assert.Equal(t, "27900704_070228_D6D51B6C", r.PhotoName) assert.IsType(t, Photo{}, r) }) t.Run("get not existing photo", func(t *testing.T) { @@ -24,7 +24,7 @@ func TestPhotoMap_Pointer(t *testing.T) { t.Run("get existing photo pointer", func(t *testing.T) { r := PhotoFixtures.Pointer("19800101_000002_D640C559") assert.Equal(t, "pt9jtdre2lvl0yh7", r.PhotoUID) - assert.Equal(t, "19800101_000002_D640C559", r.PhotoName) + assert.Equal(t, "27900704_070228_D6D51B6C", r.PhotoName) assert.IsType(t, &Photo{}, r) }) t.Run("get not existing photo pointer", func(t *testing.T) { diff --git a/internal/entity/photo_quality_test.go b/internal/entity/photo_quality_test.go index e518bb3aa..b2fc6aae2 100644 --- a/internal/entity/photo_quality_test.go +++ b/internal/entity/photo_quality_test.go @@ -8,7 +8,7 @@ import ( func TestPhoto_QualityScore(t *testing.T) { t.Run("PhotoFixture19800101_000002_D640C559", func(t *testing.T) { - assert.Equal(t, 4, PhotoFixtures.Pointer("19800101_000002_D640C559").QualityScore()) + assert.Equal(t, 3, PhotoFixtures.Pointer("19800101_000002_D640C559").QualityScore()) }) t.Run("PhotoFixturePhoto01 - favorite true - taken at before 2008", func(t *testing.T) { assert.Equal(t, 7, PhotoFixtures.Pointer("Photo01").QualityScore()) diff --git a/internal/entity/photo_test.go b/internal/entity/photo_test.go index b31a5a415..04629f5b5 100644 --- a/internal/entity/photo_test.go +++ b/internal/entity/photo_test.go @@ -452,15 +452,25 @@ func TestPhoto_UpdateTitle(t *testing.T) { } assert.Equal(t, "shortcity / Germany / 2016", m.PhotoTitle) }) - t.Run("no location", func(t *testing.T) { + t.Run("no location original name", func(t *testing.T) { m := PhotoFixtures.Get("19800101_000002_D640C559") classifyLabels := &classify.Labels{{Name: "classify", Uncertainty: 30, Source: SrcManual, Priority: 5, Categories: []string{"flower", "plant"}}} + assert.Equal(t, "Lake / 2790", m.PhotoTitle) + err := m.UpdateTitle(*classifyLabels) + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "Examplefilenameoriginal", m.PhotoTitle) + }) + t.Run("no location", func(t *testing.T) { + m := PhotoFixtures.Get("Photo01") + classifyLabels := &classify.Labels{{Name: "classify", Uncertainty: 30, Source: SrcManual, Priority: 5, Categories: []string{"flower", "plant"}}} assert.Equal(t, "", m.PhotoTitle) err := m.UpdateTitle(*classifyLabels) if err != nil { t.Fatal(err) } - assert.Equal(t, "Classify / 2008", m.PhotoTitle) + assert.Equal(t, "Classify / 2006", m.PhotoTitle) }) t.Run("no location no labels", func(t *testing.T) { m := PhotoFixtures.Get("Photo02") diff --git a/internal/photoprism/files_test.go b/internal/photoprism/files_test.go index 00592eadb..36778ec43 100644 --- a/internal/photoprism/files_test.go +++ b/internal/photoprism/files_test.go @@ -15,7 +15,7 @@ func TestFiles_Ignore(t *testing.T) { t.Fatal(err) } - assert.True(t, files.Ignore("2020/07/exampleFileName.jpg", entity.RootOriginals, time.Unix(1583460411, 0), false)) + assert.True(t, files.Ignore("2790/07/27900704_070228_D6D51B6C.jpg", entity.RootOriginals, time.Unix(1583460411, 0), false)) assert.False(t, files.Ignore("exampleFileName.jpg", entity.RootOriginals, time.Unix(1583460412, 0), false)) assert.True(t, files.Ignore("exampleFileName.jpg", entity.RootOriginals, time.Unix(1583460412, 0), false)) assert.False(t, files.Ignore("exampleFileName.jpg", entity.RootOriginals, time.Unix(1583460412, 0), true)) diff --git a/internal/query/albums_test.go b/internal/query/albums_test.go index 245bd076f..e69c8352c 100644 --- a/internal/query/albums_test.go +++ b/internal/query/albums_test.go @@ -34,7 +34,7 @@ func TestAlbumCoverByUID(t *testing.T) { t.Fatal(err) } - assert.Equal(t, "2020/07/exampleFileName.jpg", file.FileName) + assert.Equal(t, "2790/07/27900704_070228_D6D51B6C.jpg", file.FileName) }) t.Run("existing uid folder album", func(t *testing.T) { diff --git a/internal/query/files_test.go b/internal/query/files_test.go index caa9f6c59..2723cdc3d 100644 --- a/internal/query/files_test.go +++ b/internal/query/files_test.go @@ -75,7 +75,7 @@ func TestFilesByUID(t *testing.T) { t.Fatal(err) } assert.Equal(t, 1, len(files)) - assert.Equal(t, "2020/07/exampleFileName.jpg", files[0].FileName) + assert.Equal(t, "2790/07/27900704_070228_D6D51B6C.jpg", files[0].FileName) }) t.Run("no files found", func(t *testing.T) { files, err := FilesByUID([]string{"ft8es39w45bnlxxx"}, 100, 0) @@ -137,7 +137,7 @@ func TestFileByUID(t *testing.T) { t.Fatal(err) } - assert.Equal(t, "2020/07/exampleFileName.jpg", file.FileName) + assert.Equal(t, "2790/07/27900704_070228_D6D51B6C.jpg", file.FileName) }) t.Run("no files found", func(t *testing.T) { @@ -159,7 +159,7 @@ func TestFileByHash(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, "2020/07/exampleFileName.jpg", file.FileName) + assert.Equal(t, "2790/07/27900704_070228_D6D51B6C.jpg", file.FileName) }) t.Run("no files found", func(t *testing.T) { diff --git a/internal/query/photo_search_test.go b/internal/query/photo_search_test.go index a6bd9659b..2c9433efa 100644 --- a/internal/query/photo_search_test.go +++ b/internal/query/photo_search_test.go @@ -511,7 +511,7 @@ func TestPhotoSearch(t *testing.T) { f.Count = 5000 f.Offset = 0 f.Lens = 1000000 - f.Month = 2 + f.Month = 7 f.Year = 2790 f.Album = "at9lxuqxpogaaba8"