luci-app-unblockmusic: add a new function from go version

This commit is contained in:
CN_SZTL 2020-09-19 20:27:18 +08:00
parent 66694c03bb
commit bd3e5934c6
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 8 additions and 2 deletions

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-unblockmusic
PKG_VERSION:=2.3.5
PKG_RELEASE:=9
PKG_RELEASE:=10
PKG_CONFIG_DEPENDS := \
CONFIG_UnblockNeteaseMusic_Go \

View File

@ -44,6 +44,11 @@ cloudserver.default = "cdn-shanghai.service.project-openwrt.eu.org:30000:30001"
cloudserver.rmempty = true
cloudserver:depends("apptype", "cloud")
search_limit = s:option(Value, "search_limit", translate("搜索结果限制"))
search_limit.description = translate("在搜索页面显示其他平台搜索结果个数可填0-3")
search_limit.default = "0"
search_limit:depends("apptype", "go")
flac = s:option(Flag, "flac_enabled", translate("启用无损音质"))
flac.default = "1"
flac.rmempty = false

View File

@ -65,6 +65,7 @@ ENABLE=$(uci_get_by_type unblockmusic enabled 0)
TYPE=$(uci_get_by_type unblockmusic musicapptype default)
AUTOUPDATE=$(uci_get_by_type unblockmusic autoupdate 0)
APPTYPE=$(uci_get_by_type unblockmusic apptype go)
SEARCHLIMIT=$(uci_get_by_type unblockmusic search_limit 0)
FLAC=$(uci_get_by_type unblockmusic flac_enabled 0)
FORCE=$(uci_get_by_type unblockmusic force_enabled 0)
@ -187,7 +188,7 @@ start()
if [ $FLAC -eq 1 ]; then
ENABLE_FLAC="-b "
fi
UnblockNeteaseMusic $ENABLE_FLAC -p 5200 -sp 5201 -m 0 -c /usr/share/UnblockNeteaseMusicGo/server.crt -k /usr/share/UnblockNeteaseMusicGo/server.key -m 0 -e >>/tmp/unblockmusic.log 2>&1 &
UnblockNeteaseMusic $ENABLE_FLAC -p 5200 -sp 5201 -m 0 -c /usr/share/UnblockNeteaseMusicGo/server.crt -k /usr/share/UnblockNeteaseMusicGo/server.key -m 0 -e -sl ${SEARCHLIMIT} -l /tmp/unblockmusic.log &
echo "$(date -R) # UnblockNeteaseMusic Golang Version (http:5200, https:5201)" >>/tmp/unblockmusic.log
else
kill -9 $(busybox ps -w | grep 'sleep 60m' | grep -v grep | awk '{print $1}') >/dev/null 2>&1