mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Purge: Prevent SQL error when the photo ID of a file is missing #2540
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -13,6 +13,16 @@ import (
|
||||
"github.com/photoprism/photoprism/pkg/projection"
|
||||
)
|
||||
|
||||
func TestFile_RegenerateIndex(t *testing.T) {
|
||||
t.Run("FirstFileByHash", func(t *testing.T) {
|
||||
f, err := FirstFileByHash("2cad9168fa6acc5c5c2965ddf6ec465ca42fd818")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
f.RegenerateIndex()
|
||||
})
|
||||
}
|
||||
|
||||
func TestFirstFileByHash(t *testing.T) {
|
||||
t.Run("not existing file", func(t *testing.T) {
|
||||
f, err := FirstFileByHash("xxx")
|
||||
|
||||
Reference in New Issue
Block a user