mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-30 13:48:50 +08:00
commit
23fa8c036f
@ -10,7 +10,6 @@ import (
|
|||||||
"github.com/ztrue/tracerr"
|
"github.com/ztrue/tracerr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
type Command struct {
|
type Command struct {
|
||||||
commands map[string]func()
|
commands map[string]func()
|
||||||
}
|
}
|
||||||
|
@ -308,3 +308,12 @@ func (p *Player) seek(pos int) error {
|
|||||||
p.i = pos - 1
|
p.i = pos - 1
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// isPaused is used to distinguish the player between pause and stop
|
||||||
|
func (p *Player) isPaused() bool {
|
||||||
|
if p.ctrl == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return p.ctrl.Paused
|
||||||
|
}
|
||||||
|
@ -459,7 +459,6 @@ func (p *Playlist) findAudioFile(audioName string) (*AudioFile, error) {
|
|||||||
return selNode, nil
|
return selNode, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (p *Playlist) rename(newName string) error {
|
func (p *Playlist) rename(newName string) error {
|
||||||
|
|
||||||
currentNode := p.GetCurrentNode()
|
currentNode := p.GetCurrentNode()
|
||||||
@ -524,7 +523,6 @@ Download:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Download audio from youtube audio and adds the song to the selected playlist
|
// Download audio from youtube audio and adds the song to the selected playlist
|
||||||
func ytdl(url string, selPlaylist *tview.TreeNode) error {
|
func ytdl(url string, selPlaylist *tview.TreeNode) error {
|
||||||
|
|
||||||
|
6
queue.go
6
queue.go
@ -154,8 +154,9 @@ func (q *Queue) dequeue() (*AudioFile, error) {
|
|||||||
// Add item to the list and returns the length of the queue
|
// Add item to the list and returns the length of the queue
|
||||||
func (q *Queue) enqueue(audioFile *AudioFile) (int, error) {
|
func (q *Queue) enqueue(audioFile *AudioFile) (int, error) {
|
||||||
|
|
||||||
//this is to fix the problem bulk_add when paused
|
player := gomu.player
|
||||||
if !gomu.player.isRunning && os.Getenv("TEST") == "false" {
|
|
||||||
|
if !player.isRunning && !player.isPaused() && os.Getenv("TEST") == "false" {
|
||||||
|
|
||||||
gomu.player.isRunning = true
|
gomu.player.isRunning = true
|
||||||
|
|
||||||
@ -320,7 +321,6 @@ func (q *Queue) getSavedQueue() ([]string, error) {
|
|||||||
return records, nil
|
return records, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (q *Queue) help() []string {
|
func (q *Queue) help() []string {
|
||||||
|
|
||||||
return []string{
|
return []string{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user