Skip to content

Commit

Permalink
Merge pull request #1668 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Apr 28, 2024
2 parents cfeb0af + c5bc870 commit 2a6a53b
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 34 deletions.
10 changes: 0 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ if [[ -e $file ]] && ! grep -q {CONFIG} $file; then
systemctl daemon-reload
fi

# 202402226
file=/etc/default/camilladsp
if [[ -e $file ]] && grep -qs /etc/ $file; then
sed -i 's|/etc/|/srv/http/data/|' $file
mv -f /{etc,srv/http/data}/camilladsp/configs/*
fi

file=$dirsystem/autoplay.conf
grep -qs ^cd $file && sed -i '/^cd/ d' $file

#-------------------------------------------------------------------------------
installstart "$1"

Expand Down
2 changes: 1 addition & 1 deletion srv/http/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ $( '#button-pl-librandom' ).on( 'click', function() {
, message : 'Randomly add and play continuously.'
, list : '<div class="menu">'
+'<a class="sub cmd"><i class="i-music"></i>Songs</a><i class="i-play-plus submenu cmd play"></i>'
+'<a class="sub cmd album"><i class="i-album"></i>Abums</a><i class="i-play-plus submenu cmd album"></i>'
+'<a class="sub cmd album"><i class="i-album"></i>Albums</a><i class="i-play-plus submenu cmd album"></i>'
+'</div>'
, values : [ true ]
, beforeshow : () => {
Expand Down
8 changes: 0 additions & 8 deletions srv/http/assets/js/plugin/plotly-basic-2.31.1.min.js

This file was deleted.

8 changes: 8 additions & 0 deletions srv/http/assets/js/plugin/plotly-basic-2.32.0.min.js

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions srv/http/bash/bluealsa-dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

AGENT_INTERFACE = 'org.bluez.Agent1'
path = '/test/autoagent'
filesink = '/srv/http/data/shm/bluetoothsink'
statuspush = '/srv/http/bash/status-push.sh'

def property_changed( interface, changed, invalidated, path ):
for name, value in changed.items():
Expand All @@ -28,13 +30,12 @@ def property_changed( interface, changed, invalidated, path ):
if name == 'Player':
with open( '/srv/http/data/shm/bluetoothdest', 'w' ) as f: f.write( value )
elif name == 'Position' or name == 'Track':
os.system( '/srv/http/bash/status-push.sh' )
os.system( statuspush )
elif name == 'Status':
with open( '/srv/http/data/shm/player' ) as f: player = f.read().rstrip()
if value == 'playing' and player != 'bluetooth':
f.write( 'bluetooth' )
os.system( "/srv/http/bash/cmd.sh playerstart" )
os.system( '/srv/http/bash/status-push.sh' )
if value == 'playing' and not os.path.isfile( filesink ):
open( filesink, 'a' )
os.system( '/srv/http/bash/cmd.sh playerstart' )
os.system( statuspush )

if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop( set_as_default=True )
Expand Down
9 changes: 7 additions & 2 deletions srv/http/bash/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ plAddRandom() {
}
playerStart() {
local player service
player=$( < $dirshm/player )
if [[ -e $dirshm/bluetoothsink ]]; then
player=bluetooth
echo bluetooth > $dirshm/player
else
player=$( < $dirshm/player )
fi
radioStop
mpc -q stop
case $player in
Expand Down Expand Up @@ -72,7 +77,7 @@ playerStop() {
shairportStop
;;
bluetooth )
rm -f $dirshm/bluetoothdest
rm -f $dirshm/{bluetoothdest,bluetoothsink}
systemctl restart bluetooth
;;
mpd )
Expand Down
2 changes: 1 addition & 1 deletion srv/http/bash/settings/features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ snapclient )
statePlay && systemctl start snapclient
fi
else
systemctl stop snapclient
$dirbash/snapcast.sh stop
[[ $snapserver ]] && rm -f $dirsystem/snapclientserver
fi
pushRefresh
Expand Down
2 changes: 1 addition & 1 deletion srv/http/bash/settings/pkgstatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $sharedip"
;;
snapserver )
PKG=snapcast
fileconf=/etc/default/snapserver
fileconf=/etc/snapserver.conf
;;
spotifyd )
skip+='|No.*specified|no usable credentials'
Expand Down
2 changes: 1 addition & 1 deletion srv/http/bash/snapcast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fileclientip=$dirshm/clientip

if [[ $1 == start ]]; then
systemctl start snapclient
serverip=$( timeout 0.2 snapclient | awk '/Connected to/ {print $NF}' )
serverip=$( timeout 1 snapclient | awk '/Connected to/ {print $NF}' )
if [[ $serverip ]]; then
echo $serverip > $dirshm/serverip
echo snapcast > $dirshm/player
Expand Down
2 changes: 1 addition & 1 deletion srv/http/bash/status-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [[ -e $dirshm/clientip ]]; then
[[ ! $status ]] && status=$( $dirbash/status.sh ) # $statusradio
status=$( sed -E -e '1,/^, "single" *:/ d;/^, "icon" *:/ d; /^, "login" *:/ d; /^}/ d
' -e '/^, "stationcover"|^, "coverart"/ s|(" *: *")|\1http://'$serverip'|' <<< $status )
data='{ "channel": "mpdplayer", "data": { ${status:1} }'
data='{ "channel": "mpdplayer", "data": { '${status:1}' } }'
clientip=$( < $dirshm/clientip )
for ip in $clientip; do
ipOnline $ip && websocat ws://$ip:8080 <<< $( tr -d '\n' <<< $data )
Expand Down
6 changes: 3 additions & 3 deletions srv/http/bash/status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ $( $dirbash/status-bluetooth.sh )"
serverip=$( < $dirshm/serverip )
serverstatus=$( sshCommand $serverip $dirbash/status.sh snapclient )
########
status+=$( sed -E -e 's|^(, "stationcover" *: ")(.+")|\1http://'$serverip'\2|
status+=$'\n'$( sed -E -e '1,3d; $d
' -e 's|^(, "stationcover" *: ")(.+")|\1http://'$serverip'\2|
' -e 's|^(, "coverart" *: ")(.+")|\1http://'$serverip'\2|
' -e 's|^, *"icon".*|, "icon" : "snapcast"|
' -e '1d; $d
' <<< $serverstatus )
;;
spotify )
Expand Down Expand Up @@ -451,7 +451,7 @@ if [[ ! $sampling ]]; then
fi
if [[ $bitdepth == dsd ]]; then
sampling="${samplerate^^}"
else
elif [[ $samplerate ]]; then
[[ $bitdepth == 'N/A' && ( $ext == WAV || $ext == AIFF ) ]] && bitdepth=$(( bitrate / samplerate / 2 ))
sample="$( calc 1 $samplerate/1000 ) kHz"
if [[ $bitdepth && ! $ext =~ ^(AAC|MP3|OGG|Radio)$ ]]; then
Expand Down

0 comments on commit 2a6a53b

Please sign in to comment.