Reload server and edit configuration. (#15)
The first iteration for config editor and server reload from the web interface.
This commit is contained in:
parent
56d32fd1f4
commit
0e2288565d
53 changed files with 882 additions and 178 deletions
stats
|
@ -83,6 +83,13 @@ func (s *Torrent) Add(route string, t *torrent.Torrent) {
|
|||
s.torrentsByRoute[route] = append(tbr, t)
|
||||
}
|
||||
|
||||
func (s *Torrent) RemoveAll() {
|
||||
// TODO lock
|
||||
s.torrents = make(map[string]*torrent.Torrent)
|
||||
s.previousStats = make(map[string]*stats)
|
||||
s.torrentsByRoute = make(map[string][]*torrent.Torrent)
|
||||
}
|
||||
|
||||
func (s *Torrent) Stats(hash string) (*TorrentStats, error) {
|
||||
t, ok := s.torrents[hash]
|
||||
if !(ok) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue