Backend: Fix logging in File.Rename() #568

This commit is contained in:
Michael Mayer 2020-11-21 18:33:19 +01:00
parent 8516c749b7
commit 590350a6dd

View file

@ -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{}{