X-Git-Url: https://code.octet-stream.net/broadcaster/blobdiff_plain/8320951221d45c5f5f3d387c5cb4b97d9fa2094c..33a19d553807d171f6ba9f4dafe30f43bc4bab5e:/server/playlist.go diff --git a/server/playlist.go b/server/playlist.go deleted file mode 100644 index f0a6c89..0000000 --- a/server/playlist.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "sync" -) - -type Playlists struct { - changeWait chan bool - playlistMutex sync.Mutex -} - -var playlists Playlists - -func InitPlaylists() { - playlists.changeWait = make(chan bool) -} - -func (p *Playlists) GetPlaylists() []Playlist { - p.playlistMutex.Lock() - defer p.playlistMutex.Unlock() - return db.GetPlaylists() -} - -func (p *Playlists) WatchForChanges() ([]Playlist, chan bool) { - p.playlistMutex.Lock() - defer p.playlistMutex.Unlock() - return db.GetPlaylists(), p.changeWait -} - -func (p *Playlists) NotifyChanges() { - p.playlistMutex.Lock() - defer p.playlistMutex.Unlock() - close(p.changeWait) - p.changeWait = make(chan bool) -}