Added option to not add played to database
Added Search for inspiration Added song for match point
This commit is contained in:
@@ -88,3 +88,8 @@ func (m *Music) AddLatestToQue(ctx *gin.Context) {
|
||||
server.AddLatestToQue()
|
||||
ctx.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
func (m *Music) AddLatestPlayed(ctx *gin.Context) {
|
||||
server.AddLatestPlayed()
|
||||
ctx.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ func SetupRestServer(swagger embed.FS) {
|
||||
musicGroup.GET("all/random", music.GetAllGamesRandom)
|
||||
musicGroup.PUT("played", music.PutPlayed)
|
||||
musicGroup.GET("addQue", music.AddLatestToQue)
|
||||
musicGroup.GET("addPlayed", music.AddLatestPlayed)
|
||||
}
|
||||
|
||||
index := api.NewIndex()
|
||||
|
||||
@@ -36,12 +36,17 @@ func Reset() {
|
||||
func AddLatestToQue() {
|
||||
if lastFetched.Path != "" {
|
||||
currentSong = len(songQue)
|
||||
db.AddGamePlayed(lastFetched.GameId)
|
||||
songQue = append(songQue, lastFetched)
|
||||
lastFetched = models.SongData{}
|
||||
}
|
||||
}
|
||||
|
||||
func AddLatestPlayed() {
|
||||
if lastFetched.Path != "" {
|
||||
db.AddGamePlayed(lastFetched.GameId)
|
||||
}
|
||||
}
|
||||
|
||||
func GetRandomSong() string {
|
||||
if games == nil || len(games) == 0 {
|
||||
games = db.FindAllGames()
|
||||
|
||||
Reference in New Issue
Block a user