diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-07-21 21:48:59 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-07-21 21:48:59 +0200 |
| commit | 8171af55daad6ce9a5cdacf95527801e83f25c08 (patch) | |
| tree | 0e879a159bea07624687586df78f5a99d344396f /wrms.go | |
| parent | 8b4335c18752ce96e452dc232e57695c2fdf6a6d (diff) | |
| download | WRMS-8171af55daad6ce9a5cdacf95527801e83f25c08.tar.gz WRMS-8171af55daad6ce9a5cdacf95527801e83f25c08.zip | |
WIP spotify playback commit
* display spotify search results in search overlay
* synchronously play songs added from search
Diffstat (limited to 'wrms.go')
| -rw-r--r-- | wrms.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -21,6 +21,10 @@ type Song struct { Downvotes map[string]struct{} `json:"-"` } +func NewSong(title, artist, source, uri string) Song { + return Song{title, artist, source, uri, 0, 0, map[string]struct{}{}, map[string]struct{}{}} +} + func NewSongFromJson(data []byte) (Song, error) { var s Song err := json.Unmarshal(data, &s) @@ -104,6 +108,7 @@ func (wrms *Wrms) PlayPause() { wrms.Next() } ev = Event{"play", []Song{*wrms.CurrentSong}} + wrms.Player.Play(wrms.CurrentSong) } else { ev = Event{"pause", []Song{}} } |
