Handle adds and deletes
This commit is contained in:
@@ -26,8 +26,8 @@ func HandleListDirectories(torMgr *torrent.TorrentManager) (*string, error) {
|
||||
return &htmlDoc, nil
|
||||
}
|
||||
|
||||
func HandleListTorrents(directory string, t *torrent.TorrentManager, log *zap.SugaredLogger) (*string, error) {
|
||||
torrents, ok := t.DirectoryMap.Get(directory)
|
||||
func HandleListTorrents(directory string, torMgr *torrent.TorrentManager, log *zap.SugaredLogger) (*string, error) {
|
||||
torrents, ok := torMgr.DirectoryMap.Get(directory)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("cannot find directory %s", directory)
|
||||
}
|
||||
@@ -49,8 +49,8 @@ func HandleListTorrents(directory string, t *torrent.TorrentManager, log *zap.Su
|
||||
return &htmlDoc, nil
|
||||
}
|
||||
|
||||
func HandleListFiles(directory, torrentName string, t *torrent.TorrentManager, log *zap.SugaredLogger) (*string, error) {
|
||||
torrents, ok := t.DirectoryMap.Get(directory)
|
||||
func HandleListFiles(directory, torrentName string, torMgr *torrent.TorrentManager, log *zap.SugaredLogger) (*string, error) {
|
||||
torrents, ok := torMgr.DirectoryMap.Get(directory)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("cannot find directory %s", directory)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user