mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
File browser: Implement clipboard; refactor entities and fixtures #260
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
@@ -5,9 +5,9 @@ import (
|
||||
"path"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/config"
|
||||
"github.com/photoprism/photoprism/internal/entity"
|
||||
"github.com/photoprism/photoprism/internal/query"
|
||||
"github.com/photoprism/photoprism/pkg/fs"
|
||||
"github.com/photoprism/photoprism/pkg/txt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -34,12 +34,12 @@ func GetDownload(router *gin.RouterGroup, conf *config.Config) {
|
||||
fileName := path.Join(conf.OriginalsPath(), f.FileName)
|
||||
|
||||
if !fs.FileExists(fileName) {
|
||||
log.Errorf("could not find original: %s", fileHash)
|
||||
c.Data(404, "image/svg+xml", photoIconSvg)
|
||||
log.Errorf("download: file %s is missing", txt.Quote(f.FileName))
|
||||
c.Data(404, "image/svg+xml", brokenIconSvg)
|
||||
|
||||
// Set missing flag so that the file doesn't show up in search results anymore.
|
||||
report("download", f.Update("FileMissing", true))
|
||||
|
||||
// Set missing flag so that the file doesn't show up in search results anymore
|
||||
f.FileMissing = true
|
||||
entity.Db().Save(&f)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user