This commit is contained in:
aditya-K2
2023-05-19 01:10:11 +05:30
parent 4e0b1c0a41
commit fc3a19a502
3 changed files with 6 additions and 6 deletions

View File

@@ -305,11 +305,11 @@ func NewApplication() *tview.Application {
}))
topTracksView.SetActions(utils.MergeMaps(globalActions, map[string]*Action{
"play_entry": NewAction(func(e *tcell.EventKey) *tcell.EventKey {
topTracksView.PlaySelectedEntry()
topTracksView.PlayEntry()
return nil
}, progressBar),
"queue_entry": NewAction(func(e *tcell.EventKey) *tcell.EventKey {
topTracksView.QueueSelectedEntry()
topTracksView.QueueEntry()
return nil
}, nil),
}))
@@ -343,7 +343,7 @@ func NewApplication() *tview.Application {
return nil
}, progressBar),
"queue_entry": NewAction(func(e *tcell.EventKey) *tcell.EventKey {
albumsView.QueueSelectEntry()
albumsView.QueueEntry()
return nil
}, progressBar),
}))

View File

@@ -59,7 +59,7 @@ func (a *AlbumsView) PlayEntry() {
}
}
func (a *AlbumsView) QueueSelectEntry() {
func (a *AlbumsView) QueueEntry() {
r, _ := Main.GetSelection()
alb := (*a.savedAlbums)[r]
msg := SendNotificationWithChan("Queueing " + alb.Name + "...")

View File

@@ -74,7 +74,7 @@ func (a *TopTracksView) handle(trackHandler, artistHandler func(r int)) {
}
}
func (a *TopTracksView) PlaySelectedEntry() {
func (a *TopTracksView) PlayEntry() {
a.handle(nil, func(r int) {
if err := spt.PlayContext(a.topArtists[r-1].URI); err != nil {
SendNotification(err.Error())
@@ -96,7 +96,7 @@ func (a *TopTracksView) OpenEntry() {
a.handle(trackHandler, artistHandler)
}
func (a *TopTracksView) QueueSelectedEntry() {
func (a *TopTracksView) QueueEntry() {
a.handle(func(r int) {
msg := fmt.Sprintf("%s Queued Succesfully!", a.topTracks[r-2-len(a.topArtists)].Name)
if err := spt.QueueTracks(a.topTracks[r-2-len(a.topArtists)].ID); err != nil {