Oh, I found the problem. It's cut command.
This commit is contained in:
parent
65212103a3
commit
637f7c0280
@ -67,7 +67,7 @@ func (is *IcecastStatusDTO) Song() string {
|
|||||||
func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) []Song {
|
func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) []Song {
|
||||||
songs := make([]Song, 0)
|
songs := make([]Song, 0)
|
||||||
|
|
||||||
cmd := fmt.Sprintf("tail -n%d %s | head -n-1 | cut -d\" | \" -f1,4", lastNSongs+1, playlistPath)
|
cmd := fmt.Sprintf("tail -n%d %s | head -n-1 | cut -d\"|\" -f1,4", lastNSongs+1, playlistPath)
|
||||||
o := exec.Command("bash", "-c", cmd)
|
o := exec.Command("bash", "-c", cmd)
|
||||||
out, _ := o.CombinedOutput()
|
out, _ := o.CombinedOutput()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user