From 8171af55daad6ce9a5cdacf95527801e83f25c08 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 21 Jul 2022 21:48:59 +0200 Subject: WIP spotify playback commit * display spotify search results in search overlay * synchronously play songs added from search --- dummyBackend.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'dummyBackend.go') diff --git a/dummyBackend.go b/dummyBackend.go index f2eae57..d4461db 100644 --- a/dummyBackend.go +++ b/dummyBackend.go @@ -7,7 +7,7 @@ import ( type DummyBackend struct{} -func (dummy *DummyBackend) Play(song Song) { +func (dummy *DummyBackend) Play(song *Song) { } func (dummy *DummyBackend) Pause() { @@ -19,11 +19,9 @@ func (dummy *DummyBackend) Search(keyword string) []Song { return []Song{s} } -func NewDummySong(title string, artist string) Song { - s := Song{title, artist, "dummy", "", 0, 0, map[string]struct{}{}, map[string]struct{}{}} +func NewDummySong(title, artist string) Song { h := sha1.New() h.Write([]byte(title)) h.Write([]byte(artist)) - s.Uri = base64.URLEncoding.EncodeToString(h.Sum(nil)) - return s + return NewSong(title, artist, "dummy", base64.URLEncoding.EncodeToString(h.Sum(nil))) } -- cgit v1.2.3