Check for empty prev song.
This commit is contained in:
parent
f24953ae7c
commit
2e60f2bb8a
@ -31,6 +31,9 @@ var mostListened MostListenedSong
|
|||||||
// So it would be fairer to give these listeners back to a song they was
|
// So it would be fairer to give these listeners back to a song they was
|
||||||
// listening to.
|
// listening to.
|
||||||
func CheckAndUpdateMostListenedSong(cur, prev Song) {
|
func CheckAndUpdateMostListenedSong(cur, prev Song) {
|
||||||
|
if prev.Song == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
l, _ := strconv.Atoi(cur.Listeners)
|
l, _ := strconv.Atoi(cur.Listeners)
|
||||||
if l > mostListened.Listeners {
|
if l > mostListened.Listeners {
|
||||||
mostListened = MostListenedSong{
|
mostListened = MostListenedSong{
|
||||||
|
Loading…
Reference in New Issue
Block a user