mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-28 13:48:53 +08:00
commit
23fa8c036f
@ -10,7 +10,6 @@ import (
|
||||
"github.com/ztrue/tracerr"
|
||||
)
|
||||
|
||||
|
||||
type Command struct {
|
||||
commands map[string]func()
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
|
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
|
||||
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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user