Remove extra downloads directory
This commit is contained in:
@@ -34,7 +34,7 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
|
||||
|
||||
// t.log.Infof("Removing torrent %s from zurg database (not real-debrid)", accessKey)
|
||||
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) {
|
||||
if directory == config.DOWNLOADS || directory == config.DUMPED_TORRENTS {
|
||||
if directory == config.DUMPED_TORRENTS {
|
||||
return
|
||||
}
|
||||
torrents.Remove(accessKey)
|
||||
|
||||
@@ -538,7 +538,6 @@ func (t *TorrentManager) initializeDirectoryMaps() {
|
||||
}
|
||||
// create special directories
|
||||
t.DirectoryMap.Set(config.ALL_TORRENTS, cmap.New[*Torrent]())
|
||||
t.DirectoryMap.Set(config.DOWNLOADS, cmap.New[*Torrent]())
|
||||
t.DirectoryMap.Set(config.DUMPED_TORRENTS, cmap.New[*Torrent]())
|
||||
t.DirectoryMap.Set(config.UNPLAYABLE_TORRENTS, cmap.New[*Torrent]())
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ func (t *TorrentManager) assignDirectory(tor *Torrent, triggerHook bool, outputL
|
||||
accessKey := t.GetKey(tor)
|
||||
|
||||
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) {
|
||||
if strings.HasPrefix(directory, "int__") || directory == config.DOWNLOADS || directory == config.DUMPED_TORRENTS {
|
||||
if strings.HasPrefix(directory, "int__") || directory == config.DUMPED_TORRENTS {
|
||||
return
|
||||
}
|
||||
torrents.Remove(accessKey)
|
||||
|
||||
@@ -592,7 +592,7 @@ func (t *TorrentManager) canCapacityHandle() bool {
|
||||
func (t *TorrentManager) markAsUnplayable(torrent *Torrent) {
|
||||
accessKey := t.GetKey(torrent)
|
||||
for _, directory := range t.Config.GetDirectories() {
|
||||
if directory == config.DOWNLOADS || directory == config.DUMPED_TORRENTS {
|
||||
if directory == config.DUMPED_TORRENTS {
|
||||
return
|
||||
}
|
||||
torrents, _ := t.DirectoryMap.Get(directory)
|
||||
|
||||
Reference in New Issue
Block a user