Fixed some small bugs that were still present

This commit is contained in:
2024-08-15 20:12:29 +02:00
parent 3438ae9e45
commit da2829dbe2
4 changed files with 24 additions and 16 deletions

View File

@@ -22,7 +22,7 @@ func SyncGames() {
dir = "/Users/sebastian/Resilio Sync/Sorterat_test/"
}
fmt.Printf("dir: %s\n", dir)
foldersToSkip := []string{".sync"}
foldersToSkip := []string{".sync", "dist", "old"}
fmt.Println(foldersToSkip)
db.SetGameDeletionDate()
checkBrokenSongs()
@@ -127,9 +127,12 @@ func checkSongs(gameDir string, gameId int) {
path := gameDir + entry.Name()
fileName := entry.Name()
songName, _ := strings.CutSuffix(fileName, ".mp3")
println("path", path)
if db.CheckSong(path) {
println("db.CheckSong(path)", true)
db.UpdateSong(songName, fileName, path)
} else {
println("db.CheckSong(path)", false)
db.AddSong(models.SongData{GameId: gameId, SongName: songName, Path: path, FileName: fileName})
}
} else if isCoverImage(entry) {