--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local prowlarr_model = require "luci.model.prowlarr"
local m, s, o
m = taskd.docker_map("prowlarr", "prowlarr", "/usr/libexec/apps/prowlarr/prowlarr.sh",
translate("prowlarr"),
translate("Prowlarr supports both Torrent Trackers and Usenet Indexers. It integrates seamlessly with Sonarr, Radarr, Lidarr, and Readarr offering complete management of your indexers with no per app Indexer setup required - it does it all.")
.. translate("Official website:") .. ' https://docs.linuxserver.io/images/docker-prowlarr/')
s = m:section(SimpleSection, translate("Service Status"), translate("prowlarr status:"))
s:append(Template("prowlarr/status"))
s = m:section(TypedSection, "prowlarr", translate("Setup"), translate("Register user and pass when starting the first time."))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."*")
o.rmempty = false
o.default = "9696"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."*")
o.rmempty = false
o.datatype = "string"
o:value("lscr.io/linuxserver/prowlarr:develop", "lscr.io/linuxserver/prowlarr:develop")
o.default = "lscr.io/linuxserver/prowlarr:develop"
local blocks = prowlarr_model.blocks()
local home = prowlarr_model.home()
o = s:option(Value, "config_path", translate("Data path").."*")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/prowlarr/data", "/opt/docker2/compose/prowlarr/data")
o.default = "/opt/docker2/compose/prowlarr/data"
local paths, default_path = prowlarr_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m