Step to reset and rescan the autioplayer library in the background

This commit is contained in:
2021-12-31 17:42:49 +01:00
parent f0e9bbe4e0
commit 51a3a8b593

View File

@@ -61,5 +61,22 @@ step_100() {
endReturn -o $? "Error deleting ip $ip"
}
VERSION_SEQREV=10
step_102_info() { echo "Reset and rescan the music library in the background"; }
step_102_alias() { ALIAS="audioreset"; }
step_102() {
shift
local ncUser=$1
local lOcc="sudo -u www-data php $NC_INSTALL_DIR/occ"
if [ -z "$ncUser" ] ; then
echoerr " [E] Reset only for single user"
return 1
fi
exep "sudo -u www-data php \"$NC_INSTALL_DIR/occ\" audioplayer:reset $ncUser > /var/log/ncAudioRescan.log"
echoseq " [I] Rescan audioplayer database for user $ncUser"
exep "sudo -u www-data php \"$NC_INSTALL_DIR/occ\" audioplayer:scan -vvvv $ncUser >> /var/log/ncAudioRescan.log &"
}
VERSION_SEQREV=13
. /usr/local/bin/sequencer.sh