don't override torrent timestamp on edit

This commit is contained in:
nikk gitanes
2024-05-12 19:02:04 +03:00
parent d71d584425
commit 7179c4a85f

View File

@@ -2,7 +2,6 @@ package torr
import ( import (
"encoding/json" "encoding/json"
"time"
"server/settings" "server/settings"
"server/torr/state" "server/torr/state"
@@ -40,7 +39,9 @@ func AddTorrentDB(torr *Torrent) {
if t.Size == 0 && torr.Torrent != nil { if t.Size == 0 && torr.Torrent != nil {
t.Size = torr.Torrent.Length() t.Size = torr.Torrent.Length()
} }
t.Timestamp = time.Now().Unix() // don't override timestamp from DB on edit
t.Timestamp = torr.Timestamp // time.Now().Unix()
settings.AddTorrent(t) settings.AddTorrent(t)
} }