removing symlink option only copy for now

This commit is contained in:
2018-03-26 21:06:14 -04:00
parent 3f1f9e7104
commit bc612bf5e4

View File

@@ -3,7 +3,6 @@ package engine
import ( import (
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"github.com/asdine/storm" "github.com/asdine/storm"
Settings "github.com/deranjer/goTorrent/settings" Settings "github.com/deranjer/goTorrent/settings"
@@ -71,7 +70,7 @@ func MoveAndLeaveSymlink(config Settings.FullClientSettings, tHash string, db *s
return err return err
} }
os.Chmod(newFilePath, 0777) os.Chmod(newFilePath, 0777)
if runtime.GOOS != "windows" { //TODO the windows symlink is broken on windows 10 creator edition, so on the other platforms create symlink (windows will copy) until Go1.11 /* if runtime.GOOS != "windows" { //TODO the windows symlink is broken on windows 10 creator edition, so on the other platforms create symlink (windows will copy) until Go1.11
os.RemoveAll(oldFilePath) os.RemoveAll(oldFilePath)
err = os.Symlink(newFilePath, oldFilePath) err = os.Symlink(newFilePath, oldFilePath)
if err != nil { if err != nil {
@@ -79,7 +78,7 @@ func MoveAndLeaveSymlink(config Settings.FullClientSettings, tHash string, db *s
moveDone = false moveDone = false
return err return err
} }
} } */
if moveDone == false { if moveDone == false {
tStorage.TorrentMoved = true //TODO error handling instead of just saying torrent was moved when it was not tStorage.TorrentMoved = true //TODO error handling instead of just saying torrent was moved when it was not
notifyUser(tStorage, config, db) //Only notify if we haven't moved yet, don't want to push notify user every time user uses change storage button notifyUser(tStorage, config, db) //Only notify if we haven't moved yet, don't want to push notify user every time user uses change storage button