1
0

Oh, I found the problem. It's cut command.

This commit is contained in:
Alexander Andreev 2022-03-10 00:02:44 +04:00
parent 65212103a3
commit 637f7c0280
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -67,7 +67,7 @@ func (is *IcecastStatusDTO) Song() string {
func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) []Song {
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)
out, _ := o.CombinedOutput()