Fixed some bugs
* Fixed bug with sync * Made default list of game randomized * Added get all games ordered * Added air for live reload
This commit is contained in:
@@ -40,7 +40,7 @@ func SyncGames() {
|
||||
|
||||
innerFiles, err := ioutil.ReadDir(path)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
log.Println(err)
|
||||
}
|
||||
id := -1
|
||||
for _, song := range innerFiles {
|
||||
@@ -114,7 +114,7 @@ func checkSongs(gameDir string, gameId int) {
|
||||
|
||||
files, err := ioutil.ReadDir(gameDir)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
log.Println(err)
|
||||
}
|
||||
for _, entry := range files {
|
||||
path := gameDir + entry.Name()
|
||||
@@ -143,10 +143,12 @@ func checkBrokenSongs() {
|
||||
if err != nil {
|
||||
//File not found
|
||||
brokenSongs = append(brokenSongs, song)
|
||||
}
|
||||
err = openFile.Close()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
fmt.Printf("song broken: %v", song.Path)
|
||||
} else {
|
||||
err = openFile.Close()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
db.RemoveBrokenSongs(brokenSongs)
|
||||
|
||||
Reference in New Issue
Block a user