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