Merge pull request 'Remove download directory checks for Android' (#483) from priority into master
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
Reviewed-on: #483
This commit is contained in:
commit
2876fdf7f4
|
@ -11,6 +11,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
path "path/filepath"
|
path "path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -81,16 +82,18 @@ func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int,
|
||||||
return errors.New("download path or manifest path is empty")
|
return errors.New("download path or manifest path is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't download files if the download file directory does not exist
|
// We write to a temp file for Android...
|
||||||
if _, err := os.Stat(path.Dir(downloadFilePath)); os.IsNotExist(err) {
|
if runtime.GOOS != "android" {
|
||||||
return errors.New("download directory does not exist")
|
// Don't download files if the download file directory does not exist
|
||||||
}
|
if _, err := os.Stat(path.Dir(downloadFilePath)); os.IsNotExist(err) {
|
||||||
|
return errors.New("download directory does not exist")
|
||||||
|
}
|
||||||
|
|
||||||
// Don't download files if the manifest file directory does not exist
|
// Don't download files if the manifest file directory does not exist
|
||||||
if _, err := os.Stat(path.Dir(manifestFilePath)); os.IsNotExist(err) {
|
if _, err := os.Stat(path.Dir(manifestFilePath)); os.IsNotExist(err) {
|
||||||
return errors.New("manifest directory does not exist")
|
return errors.New("manifest directory does not exist")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store local.filesharing.filekey.manifest as the location of the manifest
|
// Store local.filesharing.filekey.manifest as the location of the manifest
|
||||||
profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest", key), manifestFilePath)
|
profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest", key), manifestFilePath)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue