Commit f7879bc013

f7879bc01321df006d9c95b9bd02f6bc50d6ebb1

parent: 1bb1d52305

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-19 18:23 UTC

serperate stuff

Layout: unified · split

internal/curd.go +13 −15
@@ -3,26 +3,24 @@ package internal
33import (
44 "encoding/json"
55 "fmt"
6 "io/ioutil"
67 "os"
78 "runtime"
9 "strings"
810 "time"
9 // "log"
1011)
1112
12type curdConfig struct {
13 player string
14 historyFile string
15 subs_language string
16 sub_or_dub string
17 percentageToMarkComplete int
18 nextEpisodePrompt bool
19 skipOp bool
20 skipEd bool
21 skipFiller bool
22 skipRecap bool
23 scoreOnCompletion bool
24 saveMpvSpeed bool
25 discordPresence bool
13func GetTokenFromFile(filePath string) (string, error) {
14 // Read the token from the file
15 data, err := ioutil.ReadFile(filePath)
16 if err != nil {
17 return "", fmt.Errorf("failed to read token from file: %w", err)
18 }
19
20 // Convert the byte slice to a string and remove any surrounding whitespace or newlines
21 token := strings.TrimSpace(string(data))
22
23 return token, nil
2624}
2725
2826// LogData logs the input data into a specified log file with the format [LOG] time lineNumber: logData