Merge pull request #4 from issadarkthing/master

Merge upstream changes
This commit is contained in:
tramhao 2021-02-13 23:19:15 +08:00 committed by GitHub
commit 23fa8c036f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 7 deletions

View File

@ -10,7 +10,6 @@ import (
"github.com/ztrue/tracerr"
)
type Command struct {
commands map[string]func()
}

View File

@ -308,3 +308,12 @@ func (p *Player) seek(pos int) error {
p.i = pos - 1
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
}

View File

@ -356,7 +356,7 @@ func (p *Playlist) addSongToPlaylist(
displayText := songName
if viper.GetBool("general.emoji") {
displayText = fmt.Sprintf(" %s %s",
displayText = fmt.Sprintf(" %s %s",
viper.GetString("emoji.file"), songName)
}
@ -459,7 +459,6 @@ func (p *Playlist) findAudioFile(audioName string) (*AudioFile, error) {
return selNode, nil
}
func (p *Playlist) rename(newName string) error {
currentNode := p.GetCurrentNode()
@ -524,7 +523,6 @@ Download:
}
// Download audio from youtube audio and adds the song to the selected playlist
func ytdl(url string, selPlaylist *tview.TreeNode) error {

View File

@ -154,8 +154,9 @@ func (q *Queue) dequeue() (*AudioFile, error) {
// Add item to the list and returns the length of the queue
func (q *Queue) enqueue(audioFile *AudioFile) (int, error) {
//this is to fix the problem bulk_add when paused
if !gomu.player.isRunning && os.Getenv("TEST") == "false" {
player := gomu.player
if !player.isRunning && !player.isPaused() && os.Getenv("TEST") == "false" {
gomu.player.isRunning = true
@ -320,7 +321,6 @@ func (q *Queue) getSavedQueue() ([]string, error) {
return records, nil
}
func (q *Queue) help() []string {
return []string{