mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
feat: seeding torrent only mark as success
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user