all repos — honk @ 36d540382ff0f43fc2ff1b3c07bacf608c6e9c7a

my fork of honk

fix meme saving. again.
Ted Unangst tedu@tedunangst.com
Wed, 02 Oct 2019 17:14:14 -0400
commit

36d540382ff0f43fc2ff1b3c07bacf608c6e9c7a

parent

2eeefab96eecf658f3e13bdb3b98dc5113cbf6a8

2 files changed, 7 insertions(+), 5 deletions(-)

jump to
M database.godatabase.go

@@ -292,9 +292,11 @@ if err != nil {

return 0, err } fileid, _ := res.LastInsertId() - _, err = stmtSaveFileData.Exec(xid, media, data) - if err != nil { - return 0, err + if local { + _, err = stmtSaveFileData.Exec(xid, media, data) + if err != nil { + return 0, err + } } return fileid, nil }
M fun.gofun.go

@@ -312,13 +312,13 @@ ct := http.DetectContentType(peek[:n])

fd.Close() 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 { log.Printf("error saving meme: %s", err) return x } var d Donk - d.FileID, _ = res.LastInsertId() + d.FileID = fileid d.XID = "" d.Name = name d.Media = ct