From 31441a3e3c0d3081bc4e9ead7ded8f3547f09bbf Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sun, 2 Jan 2022 12:32:33 +0100 Subject: [PATCH] fix upload tree --- internal/piwigo/files.go | 1 - internal/piwigo/piwigotools/file_to_upload.go | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/piwigo/files.go b/internal/piwigo/files.go index 117d54c..ea82a61 100644 --- a/internal/piwigo/files.go +++ b/internal/piwigo/files.go @@ -81,7 +81,6 @@ func (p *Piwigo) Upload(file *piwigotools.FileToUpload, stat *piwigotools.FileTo data.Set("original_filename", file.Name) data.Set("check_uniqueness", "true") if file.CreatedAt() != nil { - fmt.Println(file.CreatedAt()) data.Set("date_creation", file.CreatedAt().String()) } if file.CategoryId > 0 { diff --git a/internal/piwigo/piwigotools/file_to_upload.go b/internal/piwigo/piwigotools/file_to_upload.go index c063de0..d1fffe7 100644 --- a/internal/piwigo/piwigotools/file_to_upload.go +++ b/internal/piwigo/piwigotools/file_to_upload.go @@ -58,7 +58,6 @@ func (f *FileToUpload) Info() *FileInfo { info := FileInfo{ size: st.Size(), - ext: strings.ToLower(filepath.Ext(f.Name)[1:]), md5: checksum, createdAt: f.exifCreatedAt(), } @@ -86,10 +85,7 @@ func (f *FileToUpload) Size() int64 { } func (f *FileToUpload) Ext() string { - if info := f.Info(); info != nil { - return info.ext - } - return "" + return strings.ToLower(filepath.Ext(f.Name)[1:]) } func (f *FileToUpload) CreatedAt() *TimeResult {