if the file being received already exists locally, it will be renamed

This commit is contained in:
2026-02-07 19:39:14 +08:00
parent e76ada9b4b
commit e76bcd709c
13 changed files with 114 additions and 90 deletions

View File

@@ -8,11 +8,10 @@ import (
"path/filepath"
)
func (s *Service) SaveHistory() {
func (s *Service) SaveHistory(transfers []*Transfer) {
if !s.config.GetSaveHistory() {
return
}
transfers := s.GetTransferList()
configDir := config.GetConfigDir()
historyPath := filepath.Join(configDir, "history.json")
historyJson, err := json.Marshal(transfers)