Skip to content

Commit

Permalink
Merge pull request #1345 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Jun 9, 2023
2 parents 6860f6f + 5fe100b commit 4c21567
Show file tree
Hide file tree
Showing 33 changed files with 372 additions and 293 deletions.
44 changes: 30 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,28 @@ alias=r1

# restore 20230522
#. /srv/http/bash/settings/addons.sh
# 20230522
[[ -e /srv/http/bash/settings/addons.sh ]] && . /srv/http/bash/settings/addons.sh || . /srv/http/bash/addons.sh

# 20230610
rm -f $dirshm/system

file=$dirsystem/localbrowser.conf
if [[ -e $file ]]; then
rotate=$( getVar rotate $file | tr -dc [A-Z] )
if [[ $rotate ]]; then
case $rotate in
NORMAL ) degree=0;;
CCW ) degree=270;;
CW ) degree=90;;
UD ) degree=180;;
esac
sed -i "s/^rotate.*/rotate=$degree/" $file
fi
fi
rm -f /tmp/localbrowser.conf

[[ $( pacman -Q bluealsa ) != 'bluealsa 4.1.0-1' ]] && pacman -Sy --noconfirm bluealsa

# 20230528
file=$dirmpdconf/conf/snapserver.conf
if grep -q port $file; then
Expand All @@ -26,11 +45,8 @@ if [[ ! -e /boot/kernel.img && -e /lib/python3.11 && ! -e /lib/python3.11/site-p
fi

# 20230522
if crontab -l | grep -q addonsupdates; then
echo "\
00 01 * * * $dirsettings/addons-data.sh
$( crontab -l | grep -v addonsupdates )" | crontab -
fi
crontab -l | grep -q addonsupdates && echo "00 01 * * * $dirsettings/addons-data.sh" | crontab -
systemctl restart cronie

if ls $dirsystem/autoplay* &> /dev/null && [[ ! -s $dirsystem/autoplay ]]; then
k=( startup bluetooth cd )
Expand Down Expand Up @@ -207,15 +223,8 @@ sed -i "s/?v=.*/$hash';/" /srv/http/common.php
installfinish
#-------------------------------------------------------------------------------

# 20230528
if [[ -e $dirshm/mixernone && $( volumeGet valdb | jq .db ) != 0 ]]; then
rm -f $dirshm/mixernone $dirsystem/mixertype-*
$dirsettings/player-conf.sh
echo "$info Re-enable again: Volume Control - None/0dB"
fi

# 20230522
[[ ! -e $dirshm/cpuinfo ]] && cpuInfo
[[ ! -e $dirshm/cpuinfo ]] && $dirsettings/system.sh cpuinfo

! grep -q listing $dirbash/mpdidle.sh && systemctl restart mpd

Expand All @@ -232,3 +241,10 @@ if grep -q /srv/http/data /etc/exports; then
- Disable server
- Re-enable again"
fi

# 20230528
if [[ -e $dirshm/mixernone && $( volumeGet valdb | jq .db ) != 0 ]]; then
rm -f $dirshm/mixernone $dirsystem/mixertype-*
$dirsettings/player-conf.sh
echo "$info Re-enable again: Volume Control - None/0dB"
fi
5 changes: 4 additions & 1 deletion srv/http/assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@font-face {
font-family : rern;
src : url( '/assets/fonts/rern.woff2?v=1685410296' );
src : url( '/assets/fonts/rern.woff2?v=1685865311' );
}
@font-face {
font-family : Lato;
Expand Down Expand Up @@ -727,6 +727,9 @@ hr {
margin: 10px auto;
text-align: left;
}
#infoContent .menu a {
height: 41px;
}
#infoContent .menu i {
width: 40px;
}
Expand Down
16 changes: 9 additions & 7 deletions srv/http/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,6 @@ i.map.disabled, .map.disabled i {
text-align: center;
color: var( --cg60 );
}
.mode gr {
margin-left: 8px;
}
#lib-mode-list gr {
font-size: 14px;
}
Expand Down Expand Up @@ -1392,13 +1389,18 @@ i.map.disabled, .map.disabled i {
#infoIcon .button-coverart {
margin-left: 0;
}
.button-coverart::before,
.button-coverart::after {
position: relative;
margin-left: 4px;
content: '\f528';
font-family: rern;
font-size: 26px;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.button-coverart::before {
position: absolute;
content: '\f52C';
color: var( --cg );
}
.button-coverart img {
position: absolute;
Expand Down Expand Up @@ -1546,11 +1548,10 @@ i.map.disabled, .map.disabled i {
.coverart2 {
display: block;
padding-left: 2px;
line-height: 18px;
line-height: 15px;
}
.coverart1 {
padding-top: 3px;
line-height: 15px;
}
.coverart2 {
color: var( --cg60 );
Expand Down Expand Up @@ -2184,7 +2185,7 @@ li.active .li2 bl {
/************************************************************************************/
@media ( max-width: 320px ) and ( max-height: 480px ) {
#page-playback {
padding-top: 30px !important;
padding: 30px 0 0 0;
overflow: hidden;
}
#sampling,
Expand All @@ -2197,6 +2198,7 @@ li.active .li2 bl {
}
@media ( max-width: 480px ) and ( max-height: 320px ) {
#page-playback {
height: 100vh;
--scale: 0.65;
padding: 40px 0 0 !important;
}
Expand Down
Binary file modified srv/http/assets/fonts/rern.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion srv/http/assets/js/addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function renderPage() {
var version = 'version' in addon ? '&emsp;<a class="revision">'+ addon.version +' <i class="i-help"></i></a>' : '';
if ( 'revision' in addon ) {
var revision = '<p class="revisiontext hide">';
addon.revision.forEach( el => revision += '<gr>•</gr>'+ el +'<br>' );
addon.revision.forEach( el => revision += '<gr>•</gr> '+ el +'<br>' );
revision += '</p>';
} else {
var revision = '';
Expand Down
24 changes: 12 additions & 12 deletions srv/http/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ $( '.col-r .switch' ).press( function( e ) {
// ----------------------------------------------------------------------
function banner( icon, title, message, delay ) {
clearTimeout( I.timeoutbanner );
var bottom = $( '#bar-bottom' ).is( '.transparent, :hidden' ) || ! $( '#loader' ).hasClass( 'hide' ) ? '10px' : '';
$( '#banner' )
.html( '<div id="bannerIcon">'+ ico( icon ) +'</div><div id="bannerTitle">'+ title +'</div>'
+'<div id="bannerMessage">'+ message +'</div>' )
.css( 'bottom', $( '#bar-bottom' ).is( '.transparent, :hidden' ) ? '10px' : '' )
.css( 'bottom', bottom )
.removeClass( 'hide' );
if ( delay !== -1 ) I.timeoutbanner = setTimeout( bannerHide, delay || 3000 );
}
Expand Down Expand Up @@ -987,25 +988,15 @@ function local( delay ) {

// pushstream -----------------------------------------------------------------
if ( ! [ 'addonsprogress', 'guide' ].includes( page ) ) {
var pushstream = new PushStream( {
modes : 'websocket'
, reconnectOnChannelUnavailableInterval : 3000
} );
function pushstreamChannel( channels ) {
channels.forEach( channel => pushstream.addChannel( channel ) );
pushstream.connect();
}
function psNotify( data ) {
var icon = data.icon;
var title = data.title;
var message = data.message;
var delay = data.delay;

banner( icon, title, message, delay );
if ( [ 'Off ...', 'Reboot ...' ].includes( message ) ) {
var type = message.split( ' ' )[ 0 ].toLowerCase();
V[ type ] = true;
setTimeout( loader, 0 );
loader();
} else if ( ! page ) {
if ( message === 'Change track ...' ) { // audiocd
clearIntervalAll();
Expand All @@ -1015,8 +1006,17 @@ if ( ! [ 'addonsprogress', 'guide' ].includes( page ) ) {
if ( V.mode === 'latest' ) $( '#button-library' ).trigger( 'click' );
}
}
banner( icon, title, message, delay );
}

var pushstream = new PushStream( {
modes : 'websocket'
, reconnectOnChannelUnavailableInterval : 3000
} );
function pushstreamChannel( channels ) {
channels.forEach( channel => pushstream.addChannel( channel ) );
pushstream.connect();
}
pushstream.onstatuschange = status => { // 0 - disconnected; 1 - reconnect; 2 - connected
if ( status === 2 ) { // connected
if ( V.reboot ) {
Expand Down
6 changes: 3 additions & 3 deletions srv/http/assets/js/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ function addToPlaylist() {
function addToPlaylistCommand() {
if ( V.action !== 'add' && V.action !== 'playnext' ) $( '#stop' ).trigger( 'click' );
if ( D.playbackswitch && V.action.slice( -4 ) === 'play' ) $( '#playback' ).trigger( 'click' );
var sleep = [ 'http', 'rtsp' ].includes( V.list.path.slice( 0, 4 ) ) ? 1 : 0.2;
if ( S.state === 'play' && S.webradio ) sleep += 1;
if ( V.action.slice( -4 ) === 'play' ) sleep += 1;
var sleep = 0;
if ( S.stream ) sleep++;
if ( V.action.slice( -4 ) === 'play' ) sleep++;
var varaction = '';
if ( V.action === 'addplay' ) {
varaction = ' ACTION DELAY';
Expand Down
14 changes: 7 additions & 7 deletions srv/http/assets/js/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var default_v = {
, STARTUP : true
}
, localbrowser : {
ROTATE : 'NORMAL'
ROTATE : 0
, ZOOM : 100
, SCREENOFF : 0
, ONWHILEPLAY : false
Expand Down Expand Up @@ -169,10 +169,10 @@ $( '#setting-localbrowser' ).on( 'click', function() {
<table>
<tr><td style="width:110px">Rotation</td>
<td><select>
<option value="NORMAL">Normal</option>
<option value="CW">90° CW</option>
<option value="CCW">90° CCW</option>
<option value="UD">180°</option>
<option value="0">Normal</option>
<option value="90">90° CW</option>
<option value="270">90° CCW</option>
<option value="180">180°</option>
</select>
</td><td></td></tr>
<tr><td>Zoom</td>
Expand All @@ -195,8 +195,8 @@ $( '#setting-localbrowser' ).on( 'click', function() {
</table>
<div id="infoRange"><input type="range" min="0" max="255" value="${ S.brightness }"><div>Brightness</div></div><br>
<div class="btnbottom">
&nbsp;<span class="reload">Reload${ ico( 'redo' ) }</span>
<span class="screenoff">${ ico( 'screenoff' ) }On/Off</span>
&nbsp;<span class="reload">Reload ${ ico( 'redo' ) }</span>&emsp;
<span class="screenoff">${ ico( 'screenoff' ) } On/Off</span><br>&nbsp;
</div>`;
info( {
icon : SW.icon
Expand Down
Loading

0 comments on commit 4c21567

Please sign in to comment.