fix duplicate torrents (again)
This commit is contained in:
12
main.go
12
main.go
@@ -112,16 +112,10 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
guidTorrent, _ := m.GetTorrentByGuid(torrent.Guid)
|
||||
guidTorrent, _ := m.GetTorrentByGuidAndItemId(torrent.Guid, item.ID)
|
||||
if guidTorrent != nil {
|
||||
_, err = db.NamedExec("UPDATE torrents SET seeders = :seeders, peers = :peers WHERE guid = :guid", map[string]any{
|
||||
"seeders": seeders,
|
||||
"peers": peers,
|
||||
"guid": torrent.Guid,
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("couldn't update seers & peers for torrent guid=%s: %v\n", torrent.Guid, err)
|
||||
}
|
||||
// already have this exact one, for this item. ABORT!
|
||||
continue
|
||||
}
|
||||
|
||||
// this shit will duplicate. idk if it's ok or not, but fuck it. we ball
|
||||
|
||||
Reference in New Issue
Block a user