Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Commit

Permalink
Fallback to default temp dir if specified is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
SCP002 committed Mar 30, 2022
1 parent 0a09fe7 commit 866b55b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ func updateServerSettings(request RequestStruct) (settings SettingsStruct, err e
}

if err != nil {
return
showWarning(1015)
value = os.TempDir() + string(os.PathSeparator)
err = checkFilePermission(value.(string))
if err != nil {
return
}
}

case "ffmpeg.path", "vlc.path":
Expand Down
3 changes: 3 additions & 0 deletions src/screen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package src
import (
"fmt"
"log"
"os"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -247,6 +248,8 @@ func getErrMsg(errCode int) (errMsg string) {
errMsg = fmt.Sprintf("Invalid settings file (settings.json), file must be at least version %s", System.Compatibility)
case 1014:
errMsg = fmt.Sprintf("Invalid filter rule")
case 1015:
errMsg = fmt.Sprintf("Specified temp folder path is invalid, fallback to %s", os.TempDir())

case 1020:
errMsg = fmt.Sprintf("Data could not be saved, invalid keyword")
Expand Down

1 comment on commit 866b55b

@SCP002
Copy link
Owner Author

@SCP002 SCP002 commented on 866b55b Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified with ac269c1

Please sign in to comment.