From 590350a6dd86b6bb1e4cb05ab3b2c7fcaff02d8d Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sat, 21 Nov 2020 18:33:19 +0100 Subject: [PATCH] Backend: Fix logging in File.Rename() #568 --- internal/entity/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/entity/file.go b/internal/entity/file.go index 85361eb81..a7e280d91 100644 --- a/internal/entity/file.go +++ b/internal/entity/file.go @@ -227,6 +227,8 @@ func (m *File) Updates(values interface{}) error { // Rename updates the name and path of this file. func (m *File) Rename(fileName, rootName, filePath, fileBase string) error { + log.Debugf("file: renaming %s to %s", txt.Quote(m.FileName), txt.Quote(fileName)) + // Update database row. if err := m.Updates(map[string]interface{}{ "FileName": fileName, @@ -242,8 +244,6 @@ func (m *File) Rename(fileName, rootName, filePath, fileBase string) error { m.FileMissing = false m.DeletedAt = nil - log.Debugf("file: renamed %s to %s", txt.Quote(m.FileName), txt.Quote(fileName)) - // Update photo path and name if possible. if p := m.RelatedPhoto(); p != nil { return p.Updates(map[string]interface{}{