I found why time was being further altered. The reason is that slices are pointing to original array. Okay. The problem fixed.
This commit is contained in:
parent
db8e8c3ebf
commit
1b5dea899e
@ -73,7 +73,9 @@ func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error)
|
|||||||
if lastNSongs > lpcLen {
|
if lastNSongs > lpcLen {
|
||||||
lastNSongs = lpcLen
|
lastNSongs = lpcLen
|
||||||
}
|
}
|
||||||
return lastPlayedCache[lpcLen-lastNSongs:], nil
|
var ret []Song = make([]Song, lastNSongs)
|
||||||
|
copy(ret[:], lastPlayedCache[lpcLen-lastNSongs:])
|
||||||
|
return ret, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user