fix meme saving. again.
This commit is contained in:
parent
1595e1f9de
commit
bb52c24c31
|
@ -292,10 +292,12 @@ func savefile(xid string, name string, desc string, url string, media string, lo
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
fileid, _ := res.LastInsertId()
|
fileid, _ := res.LastInsertId()
|
||||||
|
if local {
|
||||||
_, err = stmtSaveFileData.Exec(xid, media, data)
|
_, err = stmtSaveFileData.Exec(xid, media, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return fileid, nil
|
return fileid, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
fun.go
4
fun.go
|
@ -312,13 +312,13 @@ func memetize(honk *Honk) {
|
||||||
fd.Close()
|
fd.Close()
|
||||||
|
|
||||||
url := fmt.Sprintf("https://%s/meme/%s", serverName, name)
|
url := fmt.Sprintf("https://%s/meme/%s", serverName, name)
|
||||||
res, err := stmtSaveFile.Exec("", name, name, url, ct, 0, "")
|
fileid, err := savefile("", name, name, url, ct, false, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error saving meme: %s", err)
|
log.Printf("error saving meme: %s", err)
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
var d Donk
|
var d Donk
|
||||||
d.FileID, _ = res.LastInsertId()
|
d.FileID = fileid
|
||||||
d.XID = ""
|
d.XID = ""
|
||||||
d.Name = name
|
d.Name = name
|
||||||
d.Media = ct
|
d.Media = ct
|
||||||
|
|
Loading…
Reference in New Issue