Skip to content

Commit

Permalink
luci-app-qbittorrent: tidy up code (coolsnowwolf#8194)
Browse files Browse the repository at this point in the history
  • Loading branch information
Beginner-Go authored Nov 7, 2021
1 parent 1d22d22 commit f018238
Show file tree
Hide file tree
Showing 13 changed files with 509 additions and 448 deletions.
13 changes: 6 additions & 7 deletions package/lean/luci-app-qbittorrent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

include $(TOPDIR)/rules.mk


PKG_NAME:=luci-app-qbittorrent
PKG_VERSION=1.0
PKG_RELEASE:=22
PKG_RELEASE:=23

include $(INCLUDE_DIR)/package.mk
LUCI_TITLE:=LuCI support for qBittorrent
LUCI_PKGARCH:=all
LUCI_DEPENDS:= \
+PACKAGE_luci-app-qbittorrent_static:qBittorrent-static \
+PACKAGE_luci-app-qbittorrent_dynamic:qbittorrent

define Package/$(PKG_NAME)/config
choice
Expand All @@ -28,10 +31,6 @@ define Package/$(PKG_NAME)/config
endchoice
endef

LUCI_TITLE:=LuCI support for qBittorrent
LUCI_DEPENDS:=+PACKAGE_luci-app-qbittorrent_static:qBittorrent-static +PACKAGE_luci-app-qbittorrent_dynamic:qbittorrent
LUCI_PKGARCH:=all

include $(TOPDIR)/feeds/luci/luci.mk

# call BuildPackage - OpenWrt buildroot signature
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ function index()
return
end

entry({"admin", "nas", "qBittorrent"}, cbi("qbittorrent"), _("qBittorrent"))
entry({"admin", "nas", "qBittorrent"}, alias("admin", "nas", "qBittorrent", "basic"), _("qBittorrent"), 30).dependent = true
entry({"admin", "nas", "qBittorrent", "basic"}, cbi("qbittorrent/basic"), _("Basic Settings"), 1).leaf = true
entry({"admin", "nas", "qBittorrent", "connection"}, cbi("qbittorrent/connection"), _("Connection Settings"), 2).leaf = true
entry({"admin", "nas", "qBittorrent", "downloads"}, cbi("qbittorrent/downloads"), _("Download Settings"), 3).leaf = true
entry({"admin", "nas", "qBittorrent", "bittorrent"}, cbi("qbittorrent/bittorrent"), _("Bittorrent Settings"), 4).leaf = true
entry({"admin", "nas", "qBittorrent", "webgui"}, cbi("qbittorrent/webgui"), _("WebUI Settings"), 5).leaf = true
entry({"admin", "nas", "qBittorrent", "advanced"}, cbi("qbittorrent/advanced"), _("Advance Settings"), 6).leaf = true
entry({"admin", "nas", "qBittorrent", "status"}, call("act_status")).leaf = true
end

function act_status()
local e={}
e.running=luci.sys.call("pgrep qbittorrent-nox >/dev/null")==0
local e = {}
e.running = luci.sys.call("pgrep qbittorrent-nox >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
end
Loading

0 comments on commit f018238

Please sign in to comment.