Remove extra downloads directory

This commit is contained in:
Ben Adrian Sarmiento
2024-07-21 02:37:32 +02:00
parent f8b9f8955b
commit 8d06ce88d3
4 changed files with 3 additions and 4 deletions

View File

@@ -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.log.Infof("Removing torrent %s from zurg database (not real-debrid)", accessKey)
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) { 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 return
} }
torrents.Remove(accessKey) torrents.Remove(accessKey)

View File

@@ -538,7 +538,6 @@ func (t *TorrentManager) initializeDirectoryMaps() {
} }
// create special directories // create special directories
t.DirectoryMap.Set(config.ALL_TORRENTS, cmap.New[*Torrent]()) 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.DUMPED_TORRENTS, cmap.New[*Torrent]())
t.DirectoryMap.Set(config.UNPLAYABLE_TORRENTS, cmap.New[*Torrent]()) t.DirectoryMap.Set(config.UNPLAYABLE_TORRENTS, cmap.New[*Torrent]())
} }

View File

@@ -357,7 +357,7 @@ func (t *TorrentManager) assignDirectory(tor *Torrent, triggerHook bool, outputL
accessKey := t.GetKey(tor) accessKey := t.GetKey(tor)
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) { 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 return
} }
torrents.Remove(accessKey) torrents.Remove(accessKey)

View File

@@ -592,7 +592,7 @@ func (t *TorrentManager) canCapacityHandle() bool {
func (t *TorrentManager) markAsUnplayable(torrent *Torrent) { func (t *TorrentManager) markAsUnplayable(torrent *Torrent) {
accessKey := t.GetKey(torrent) accessKey := t.GetKey(torrent)
for _, directory := range t.Config.GetDirectories() { for _, directory := range t.Config.GetDirectories() {
if directory == config.DOWNLOADS || directory == config.DUMPED_TORRENTS { if directory == config.DUMPED_TORRENTS {
return return
} }
torrents, _ := t.DirectoryMap.Get(directory) torrents, _ := t.DirectoryMap.Get(directory)