mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-28 13:48:53 +08:00
After delete a song, also delete it from queue if it's in there
This commit is contained in:
parent
6e742dcfda
commit
0986f645ad
@ -192,6 +192,7 @@ func (p *Playlist) deleteSong(audioFile *AudioFile) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
audioName := getName(audioFile.path)
|
||||||
err := os.Remove(audioFile.path)
|
err := os.Remove(audioFile.path)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -204,8 +205,14 @@ func (p *Playlist) deleteSong(audioFile *AudioFile) (err error) {
|
|||||||
|
|
||||||
defaultTimedPopup(" Success ",
|
defaultTimedPopup(" Success ",
|
||||||
audioFile.name+"\nhas been deleted successfully")
|
audioFile.name+"\nhas been deleted successfully")
|
||||||
|
|
||||||
p.refresh()
|
p.refresh()
|
||||||
|
|
||||||
|
songPaths := gomu.queue.getItems()
|
||||||
|
for i, songPath := range songPaths {
|
||||||
|
if strings.Contains(songPath, audioName) {
|
||||||
|
gomu.queue.deleteItem(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user