This commit is contained in:
parent
808953f46f
commit
b98be1fd70
1 changed files with 4 additions and 1 deletions
|
@ -175,12 +175,15 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
|
||||||
modTime := info.ModTime().UTC().Round(time.Second)
|
modTime := info.ModTime().UTC().Round(time.Second)
|
||||||
size := info.Size()
|
size := info.Size()
|
||||||
|
|
||||||
_, err = tx.Exec(r.Context(), "UPDATE files SET old_md5 = md5, old_size = size WHERE id = $1", fileid)
|
_, err = tx.Exec(r.Context(), "UPDATE files SET old_md5 = md5, old_size = size, old_ffprobe_data = ffprobe_data WHERE id = $1", fileid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorUpload(r, w, taskid, "Set File Hash", err)
|
errorUpload(r, w, taskid, "Set File Hash", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO insert new ffprobe data, or schedule new scan somehow?
|
||||||
|
// maybe let the scan to all of this?
|
||||||
|
|
||||||
_, err = tx.Exec(r.Context(), "UPDATE files SET md5 = $2, size = $3, mod_time = $3 WHERE id = $1", fileid, hash, size, modTime)
|
_, err = tx.Exec(r.Context(), "UPDATE files SET md5 = $2, size = $3, mod_time = $3 WHERE id = $1", fileid, hash, size, modTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorUpload(r, w, taskid, "Set File Hash", err)
|
errorUpload(r, w, taskid, "Set File Hash", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue