- Add PROPFIND for root path

- Reduce signifcantly memoery footprint
- Fix minor bugs
This commit is contained in:
Mukhtar Akere
2025-05-20 12:57:27 +01:00
parent 53748ea297
commit 5aa1c67544
36 changed files with 632 additions and 335 deletions

View File

@@ -42,3 +42,11 @@ func New() *QBit {
downloadSemaphore: make(chan struct{}, cmp.Or(cfg.MaxDownloads, 5)),
}
}
func (q *QBit) Reset() {
if q.Storage != nil {
q.Storage.Reset()
}
q.Tags = nil
close(q.downloadSemaphore)
}

View File

@@ -1,8 +1,8 @@
package qbit
import (
"encoding/json"
"fmt"
"github.com/goccy/go-json"
"github.com/sirrobot01/decypharr/pkg/service"
"os"
"sort"
@@ -272,3 +272,9 @@ func (ts *TorrentStorage) saveToFile() error {
}
return os.WriteFile(ts.filename, data, 0644)
}
func (ts *TorrentStorage) Reset() {
ts.mu.Lock()
defer ts.mu.Unlock()
ts.torrents = make(Torrents)
}