Refactor delete
This commit is contained in:
@@ -11,7 +11,7 @@ services:
|
||||
- ./config.yml:/app/config.yml
|
||||
- ./data:/app/data
|
||||
- ./dump:/app/dump
|
||||
- ./plex_update2.sh:/app/plex_update2.sh
|
||||
- ./plex_update.sh:/app/plex_update.sh
|
||||
|
||||
rclone:
|
||||
image: rclone/rclone:latest
|
||||
@@ -29,4 +29,4 @@ services:
|
||||
- apparmor:unconfined
|
||||
devices:
|
||||
- /dev/fuse
|
||||
command: "mount zurg: /data --allow-non-empty --allow-other --attr-timeout 10y --buffer-size 4M --dir-cache-time 120s --poll-interval 60s --vfs-cache-max-age 2M --vfs-cache-max-size 2G --vfs-cache-min-free-space 200M --vfs-cache-mode full --vfs-cache-poll-interval 30s --vfs-disk-space-total-size 6G --vfs-fast-fingerprint --vfs-read-ahead 4M --vfs-read-chunk-size 8M --vfs-read-chunk-size-limit 0 --vfs-read-wait 5ms --vfs-refresh"
|
||||
command: "mount zurg: /data --allow-non-empty --allow-other --vfs-read-chunk-size 1M"
|
||||
|
||||
@@ -36,13 +36,13 @@ func HandleDeleteFile(directory, torrentName, fileName string, torMgr *torrent.T
|
||||
dirCfg := torMgr.Config.(*config.ZurgConfigV1).GetDirectoryConfig(directory)
|
||||
if dirCfg.OnlyShowTheBiggestFile {
|
||||
torMgr.Delete(torrentName, true)
|
||||
} else {
|
||||
if err := file.State.Event(context.Background(), "delete_file"); err != nil {
|
||||
return fmt.Errorf("cannot delete file %s: %v", fileName, err)
|
||||
}
|
||||
if torMgr.CheckDeletedStatus(torrent) {
|
||||
torMgr.Delete(torrentName, true)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if err := file.State.Event(context.Background(), "delete_file"); err != nil {
|
||||
return fmt.Errorf("cannot delete file %s: %v", fileName, err)
|
||||
}
|
||||
if torMgr.CheckDeletedStatus(torrent) {
|
||||
torMgr.Delete(torrentName, true)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user