From 51a3a8b59326e635b991a039614c7afd6d34c64a Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Fri, 31 Dec 2021 17:42:49 +0100 Subject: [PATCH] Step to reset and rescan the autioplayer library in the background --- seqs/nextcloud.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/seqs/nextcloud.sh b/seqs/nextcloud.sh index 7fce9d3..c9e8c98 100755 --- a/seqs/nextcloud.sh +++ b/seqs/nextcloud.sh @@ -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