var config ServerConfig = NewServerConfig()
-// Channel that will be closed and recreated every time the playlists change
-var playlistChangeWait = make(chan bool)
-
func main() {
configFlag := flag.String("c", "", "path to configuration file")
// TODO: support this
InitDatabase()
defer db.CloseDatabase()
+ InitPlaylists()
InitAudioFiles(config.AudioFilesPath)
InitServerStatus()
}
db.SetEntriesForPlaylist(cleanedEntries, id)
// Notify connected radios
- close(playlistChangeWait)
- playlistChangeWait = make(chan bool)
+ playlists.NotifyChanges()
}
http.Redirect(w, r, "/playlist/", http.StatusFound)
}
return
}
db.DeletePlaylist(id)
+ playlists.NotifyChanges()
}
http.Redirect(w, r, "/playlist/", http.StatusFound)
}