kylejohnson / Patiobar

A web frontend for pianobar, which is a CLI frontend for Pandora.
MIT License
62 stars 22 forks source link

Files missing #2

Closed chasecromwell closed 6 years ago

chasecromwell commented 8 years ago

Error: ENOENT: no such file or directory, open '/root/.config/pianobar/currentSong' at Object.fs.openSync (fs.js:557:18) at Object.fs.readFileSync (fs.js:467:33) at readCurrentSong (/home/pi/Patiobar/index.js:15:23) at Namespace. (/home/pi/Patiobar/index.js:62:2) at emitOne (events.js:96:13) at Namespace.emit (events.js:188:7) at Namespace.emit (/home/pi/Patiobar/node_modules/socket.io/lib/namespace.js:205:10) at /home/pi/Patiobar/node_modules/socket.io/lib/namespace.js:172:14 at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9)

chasecromwell commented 8 years ago

It looks like currentSong isn't being created or populated.

kylejohnson commented 8 years ago

Hey, a user! You need to set up a few external things to make this work.

[kjohnson@kyle-arch ~]$ cat .config/pianobar/config 
audio_quality = high
event_command = ~/.config/pianobar/eventcmd.sh
fifo = ~/.config/pianobar/ctl

and

[kjohnson@kyle-arch ~]$ cat ~/.config/pianobar/eventcmd.sh
host="http://127.0.0.1"
port=3000
baseurl="${host}:${port}"

# Here be dragons! #
# (Don't change anything below) #

stationList="${HOME}/.config/pianobar/stationList"
currentSong="${HOME}/.config/pianobar/currentSong"

while read L; do
        k="`echo "$L" | cut -d '=' -f 1`"
        v="`echo "$L" | cut -d '=' -f 2`"
        export "$k=$v"
done < <(grep -e '^\(title\|artist\|album\|stationName\|songStationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|coverArt\|stationCount\|station[0-9]*\)=' /dev/stdin) # don't overwrite $1...

post () {
        url=${baseurl}${1}
        curl -s -XPOST $url >/dev/null 2>&1
}

clean () {
        query=$1
        clean=$(echo $query | sed 's/ /%20/g')
        post $clean
}

stationList () {
        if [ -f "$stationList" ]; then
                rm "$stationList"
        fi

        end=`expr $stationCount - 1`

        for i in $(eval echo "{0..$end}"); do
                sn=station${i}
                eval sn=\$$sn
                echo "${i}:${sn}" >> "$stationList"
        done
}

case "$1" in
        songstart)
                query="/start/?title=${title}&artist=${artist}&coverArt=${coverArt}&album=${album}&rating=${rating}"
#               clean "$query"

                echo -n "${artist},${title},${album},${coverArt}" > "$currentSong"

                stationList
                ;;

#       songfinish)
#               ;;

        songlove)
                query="/lovehate/?rating=${rating}"
#               clean $query
                ;;

#       songshelf)
#               ;;

        songban)
                query="/lovehate/?rating=${rating}"
#               clean $query
                ;;

#       songbookmark)
#               ;;

#       artistbookmark)
#               ;;

esac
kylejohnson commented 7 years ago

Did you get this sorted out?

chasecromwell commented 7 years ago

Yep. Turned out it was just a spelling error.

Get Outlook for Androidhttps://aka.ms/ghei36

On Tue, Dec 13, 2016 at 11:56 AM -0700, "Kyle Johnson" notifications@github.com<mailto:notifications@github.com> wrote:

Did you get this sorted out?

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/kylejohnson/Patiobar/issues/2#issuecomment-266827999, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMYdIYycdwzrtkw-sH4dOp6c9UIfnMwsks5rHuo_gaJpZM4K9RC2.

devoid1 commented 7 years ago

hey kyle, nice work... however... im having this same problem and when i went in to edit the files i noticed that Patiobar had added all sorts of references to /home/pi/.config/Patiobar for the CurrentSong file but i tried to make my config match yours. i couldnt find an eventcmd at all so i cut and pasted yours from above, made it executable and started pianobar. im getting this error

/!\ Cannot start eventcmd. (Exec format error)

my pianobar/config is `tls_fingerprint = FC2E6AF49FC63AEDAD1078DC22D1185B809E7534

user = user@user.com

password = 123456

autostart_station = 20

audio_quality = high

event_command = /home/pi/.config/pianobar/eventcmd.sh

fifo = ~/.config/pianobar/ctl

`

devoid1 commented 7 years ago

@kylejohnson hey is there any way to get debug information on why eventcmd wont run? i pulled down your exact eventcmd and it still wont work. says exec format error

devoid1 commented 7 years ago

user error. figured it out. good grief.

thebradness commented 5 years ago

For anyone else seeing the error "Cannot start eventcmd. (Exec format error)", add this line to the top of your script:

!/bin/sh