fix upload tree

This commit is contained in:
Celogeek 2022-01-02 12:32:33 +01:00
parent 95f3963579
commit 31441a3e3c
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A
2 changed files with 1 additions and 6 deletions

View File

@ -81,7 +81,6 @@ func (p *Piwigo) Upload(file *piwigotools.FileToUpload, stat *piwigotools.FileTo
data.Set("original_filename", file.Name) data.Set("original_filename", file.Name)
data.Set("check_uniqueness", "true") data.Set("check_uniqueness", "true")
if file.CreatedAt() != nil { if file.CreatedAt() != nil {
fmt.Println(file.CreatedAt())
data.Set("date_creation", file.CreatedAt().String()) data.Set("date_creation", file.CreatedAt().String())
} }
if file.CategoryId > 0 { if file.CategoryId > 0 {

View File

@ -58,7 +58,6 @@ func (f *FileToUpload) Info() *FileInfo {
info := FileInfo{ info := FileInfo{
size: st.Size(), size: st.Size(),
ext: strings.ToLower(filepath.Ext(f.Name)[1:]),
md5: checksum, md5: checksum,
createdAt: f.exifCreatedAt(), createdAt: f.exifCreatedAt(),
} }
@ -86,10 +85,7 @@ func (f *FileToUpload) Size() int64 {
} }
func (f *FileToUpload) Ext() string { func (f *FileToUpload) Ext() string {
if info := f.Info(); info != nil { return strings.ToLower(filepath.Ext(f.Name)[1:])
return info.ext
}
return ""
} }
func (f *FileToUpload) CreatedAt() *TimeResult { func (f *FileToUpload) CreatedAt() *TimeResult {