Fixed bug where wrong song was showed as currently played.
This commit is contained in:
@@ -16,11 +16,15 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
testf()
|
testf()
|
||||||
|
|
||||||
data := VersionData{Version: "2.1.0",
|
data := VersionData{Version: "2.1.1",
|
||||||
|
Changelog: "Fixed bug where wrong song was showed as currently played.",
|
||||||
|
History: []VersionData{
|
||||||
|
{
|
||||||
|
Version: "2.1.0",
|
||||||
Changelog: "Added /addQue to add the last received song to the songQue. " +
|
Changelog: "Added /addQue to add the last received song to the songQue. " +
|
||||||
"Changed /rand and /rand/low to not add song to the que. " +
|
"Changed /rand and /rand/low to not add song to the que. " +
|
||||||
"Changed /next to not call /rand when the end of the que is reached, instead the last song in the que will be resent.",
|
"Changed /next to not call /rand when the end of the que is reached, instead the last song in the que will be resent.",
|
||||||
History: []VersionData{
|
},
|
||||||
{
|
{
|
||||||
Version: "2.0.3",
|
Version: "2.0.3",
|
||||||
Changelog: "Another small change that should fix the caching problem.",
|
Changelog: "Another small change that should fix the caching problem.",
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ func reset() {
|
|||||||
|
|
||||||
func addLatestToQue() {
|
func addLatestToQue() {
|
||||||
if lastFetched.path != "" {
|
if lastFetched.path != "" {
|
||||||
|
currentSong = len(songQue)
|
||||||
songQue = append(songQue, lastFetched)
|
songQue = append(songQue, lastFetched)
|
||||||
|
lastFetched = SongData{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,12 +48,9 @@ func getRandomSong() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
game := getRandomGame(games)
|
game := getRandomGame(games)
|
||||||
|
|
||||||
songs := findSongsFromGame(game.id)
|
songs := findSongsFromGame(game.id)
|
||||||
|
|
||||||
song := songs[rand.Intn(len(songs))]
|
song := songs[rand.Intn(len(songs))]
|
||||||
|
|
||||||
currentSong = len(songQue)
|
|
||||||
lastFetched = song
|
lastFetched = song
|
||||||
return song.path
|
return song.path
|
||||||
}
|
}
|
||||||
@@ -75,12 +74,9 @@ func getRandomSongLowChance() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
game := getRandomGame(listOfGames)
|
game := getRandomGame(listOfGames)
|
||||||
|
|
||||||
songs := findSongsFromGame(game.id)
|
songs := findSongsFromGame(game.id)
|
||||||
|
|
||||||
song := songs[rand.Intn(len(songs))]
|
song := songs[rand.Intn(len(songs))]
|
||||||
|
|
||||||
currentSong = len(songQue)
|
|
||||||
lastFetched = song
|
lastFetched = song
|
||||||
return song.path
|
return song.path
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user