mirror of
https://github.com/celogeek/piwigo-cli.git
synced 2025-05-25 10:12:37 +02:00
fix upload tree
This commit is contained in:
parent
95f3963579
commit
31441a3e3c
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user