Backend: Fix logging in File.Rename() #568
This commit is contained in:
parent
8516c749b7
commit
590350a6dd
1 changed files with 2 additions and 2 deletions
|
@ -227,6 +227,8 @@ func (m *File) Updates(values interface{}) error {
|
||||||
|
|
||||||
// Rename updates the name and path of this file.
|
// Rename updates the name and path of this file.
|
||||||
func (m *File) Rename(fileName, rootName, filePath, fileBase string) error {
|
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.
|
// Update database row.
|
||||||
if err := m.Updates(map[string]interface{}{
|
if err := m.Updates(map[string]interface{}{
|
||||||
"FileName": fileName,
|
"FileName": fileName,
|
||||||
|
@ -242,8 +244,6 @@ func (m *File) Rename(fileName, rootName, filePath, fileBase string) error {
|
||||||
m.FileMissing = false
|
m.FileMissing = false
|
||||||
m.DeletedAt = nil
|
m.DeletedAt = nil
|
||||||
|
|
||||||
log.Debugf("file: renamed %s to %s", txt.Quote(m.FileName), txt.Quote(fileName))
|
|
||||||
|
|
||||||
// Update photo path and name if possible.
|
// Update photo path and name if possible.
|
||||||
if p := m.RelatedPhoto(); p != nil {
|
if p := m.RelatedPhoto(); p != nil {
|
||||||
return p.Updates(map[string]interface{}{
|
return p.Updates(map[string]interface{}{
|
||||||
|
|
Loading…
Reference in a new issue