feat: seeding torrent only mark as success

This commit is contained in:
Simon Ding
2025-04-23 16:43:39 +08:00
parent 8b11e72427
commit 9c7129660c
2 changed files with 26 additions and 4 deletions

View File

@@ -98,6 +98,15 @@ func (s *Server) RemoveActivity(c *gin.Context) (interface{}, error) {
if err := s.core.RemoveTaskAndTorrent(his.ID); err != nil {
return nil, errors.Wrap(err, "remove torrent")
}
if his.Status == history.StatusSeeding {
//seeding, will mark as complete
log.Infof("history is now seeding, will only mark history as success: (%d) %s", his.ID, his.SourceTitle)
if err := s.db.SetHistoryStatus(his.ID, history.StatusSuccess); err!= nil {
return nil, errors.Wrap(err, "set status")
}
return nil, nil
}
err := s.db.DeleteHistory(in.ID)
if err != nil {
return nil, errors.Wrap(err, "db")