Fixed bug where wrong song was showed as currently played.
This commit is contained in:
@@ -36,7 +36,9 @@ func reset() {
|
||||
|
||||
func addLatestToQue() {
|
||||
if lastFetched.path != "" {
|
||||
currentSong = len(songQue)
|
||||
songQue = append(songQue, lastFetched)
|
||||
lastFetched = SongData{}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,12 +48,9 @@ func getRandomSong() string {
|
||||
}
|
||||
|
||||
game := getRandomGame(games)
|
||||
|
||||
songs := findSongsFromGame(game.id)
|
||||
|
||||
song := songs[rand.Intn(len(songs))]
|
||||
|
||||
currentSong = len(songQue)
|
||||
lastFetched = song
|
||||
return song.path
|
||||
}
|
||||
@@ -75,12 +74,9 @@ func getRandomSongLowChance() string {
|
||||
}
|
||||
|
||||
game := getRandomGame(listOfGames)
|
||||
|
||||
songs := findSongsFromGame(game.id)
|
||||
|
||||
song := songs[rand.Intn(len(songs))]
|
||||
|
||||
currentSong = len(songQue)
|
||||
lastFetched = song
|
||||
return song.path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user