When only biggest file is shown, when deleting, delete immediately
This commit is contained in:
@@ -3,6 +3,7 @@ package dav
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/debridmediamanager/zurg/internal/config"
|
||||
"github.com/debridmediamanager/zurg/internal/torrent"
|
||||
)
|
||||
|
||||
@@ -31,9 +32,14 @@ func HandleDeleteFile(directory, torrentName, fileName string, torMgr *torrent.T
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot find file %s", fileName)
|
||||
}
|
||||
dirCfg := torMgr.Config.(*config.ZurgConfigV1).GetDirectoryConfig(directory)
|
||||
if dirCfg.OnlyShowTheBiggestFile {
|
||||
torMgr.Delete(torrentName, true)
|
||||
} else {
|
||||
file.Link = "unselect"
|
||||
if torMgr.CheckDeletedStatus(torrent) {
|
||||
torMgr.Delete(torrentName, true)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user