We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74e5c4e commit add7ea4Copy full SHA for add7ea4
internal/actions/actions.go
@@ -119,9 +119,12 @@ func GetTorrentStatus(g *gocui.Gui, v *gocui.View) error {
119
func DownloadFile(torrent models.TorrentFileDetailed) error {
120
path := filepath.Join(config.DownloadPath(), torrent.Filename)
121
122
- if _, err := os.Stat(path); err == nil {
123
- logs.LogEvent(fmt.Errorf("file already exists, skipping: %s", path))
124
- return err
+ if fileInfo, err := os.Stat(path); err == nil {
+ fileSize := fileInfo.Size()
+ if fileSize >= torrent.Filesize {
125
+ logs.LogEvent(fmt.Errorf("file already exists, skipping: %s", path))
126
+ return err
127
+ }
128
}
129
// TODO
130
// this request does not require authorization
0 commit comments