1 -- Copyright 2012 Gabor Juhos <juhosg@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
6 m = Map("minidlna", translate("miniDLNA"),
7 translate("MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP-AV clients."))
9 m:section(SimpleSection).template = "minidlna_status"
11 s = m:section(TypedSection, "minidlna", "miniDLNA Settings")
15 s:tab("general", translate("General Settings"))
16 s:tab("advanced", translate("Advanced Settings"))
18 o = s:taboption("general", Flag, "enabled", translate("Enable:"))
21 function o.cfgvalue(self, section)
22 return luci.sys.init.enabled("minidlna") and self.enabled or self.disabled
25 function o.write(self, section, value)
27 luci.sys.init.enable("minidlna")
28 luci.sys.call("/etc/init.d/minidlna start >/dev/null")
30 luci.sys.call("/etc/init.d/minidlna stop >/dev/null")
31 luci.sys.init.disable("minidlna")
34 return Flag.write(self, section, value)
37 o = s:taboption("general", Value, "port", translate("Port:"),
38 translate("Port for HTTP (descriptions, SOAP, media transfer) traffic."))
43 o = s:taboption("general", Value, "interface", translate("Interfaces:"),
44 translate("Network interfaces to serve."))
46 o.template = "cbi/network_ifacelist"
50 function o.cfgvalue(self, section)
52 local val = Value.cfgvalue(self, section)
55 for ifc in val:gmatch("[^,%s]+") do
62 function o.write(self, section, value)
65 for ifc in luci.util.imatch(value) do
68 Value.write(self, section, table.concat(rv, ","))
72 o = s:taboption("general", Value, "friendly_name", translate("Friendly name:"),
73 translate("Set this if you want to customize the name that shows up on your clients."))
75 o.placeholder = "OpenWrt DLNA Server"
77 o = s:taboption("advanced", Value, "db_dir", translate("Database directory:"),
78 translate("Set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache."))
80 o.placeholder = "/var/cache/minidlna"
82 o = s:taboption("advanced", Value, "log_dir", translate("Log directory:"),
83 translate("Set this if you would like to specify the directory where you want MiniDLNA to store its log file."))
85 o.placeholder = "/var/log"
87 s:taboption("advanced", Flag, "inotify", translate("Enable inotify:"),
88 translate("Set this to enable inotify monitoring to automatically discover new files."))
90 s:taboption("advanced", Flag, "enable_tivo", translate("Enable TIVO:"),
91 translate("Set this to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO."))
94 o = s:taboption("advanced", Flag, "strict_dlna", translate("Strict to DLNA standard:"),
95 translate("Set this to strictly adhere to DLNA standards. This will allow server-side downscaling of very large JPEG images, which may hurt JPEG serving performance on (at least) Sony DLNA products."))
98 o = s:taboption("advanced", Value, "presentation_url", translate("Presentation URL:"))
100 o.placeholder = "http://192.168.1.1/"
102 o = s:taboption("advanced", Value, "notify_interval", translate("Notify interval:"),
103 translate("Notify interval in seconds."))
104 o.datatype = "uinteger"
107 o = s:taboption("advanced", Value, "serial", translate("Announced serial number:"),
108 translate("Serial number the miniDLNA daemon will report to clients in its XML description."))
109 o.placeholder = "12345678"
111 s:taboption("advanced", Value, "model_number", translate("Announced model number:"),
112 translate("Model number the miniDLNA daemon will report to clients in its XML description."))
115 o = s:taboption("advanced", Value, "minissdpsocket", translate("miniSSDP socket:"),
116 translate("Specify the path to the MiniSSDPd socket."))
118 o.placeholder = "/var/run/minissdpd.sock"
120 o = s:taboption("general", ListValue, "root_container", translate("Root container:"))
121 o:value(".", translate("Standard container"))
122 o:value("B", translate("Browse directory"))
123 o:value("M", translate("Music"))
124 o:value("V", translate("Video"))
125 o:value("P", translate("Pictures"))
128 s:taboption("general", DynamicList, "media_dir", translate("Media directories:"),
129 translate("Set this to the directory you want scanned. If you want to restrict the directory to a specific content type, you can prepend the type ('A' for audio, 'V' for video, 'P' for images), followed by a comma, to the directory (eg. media_dir=A,/mnt/media/Music). Multiple directories can be specified."))
132 o = s:taboption("general", DynamicList, "album_art_names", translate("Album art names:"),
133 translate("This is a list of file names to check for when searching for album art."))
135 o.placeholder = "Cover.jpg"
137 function o.cfgvalue(self, section)
140 local val = Value.cfgvalue(self, section)
141 if type(val) == "table" then
142 val = table.concat(val, "/")
148 for file in val:gmatch("[^/%s]+") do
155 function o.write(self, section, value)
158 for file in luci.util.imatch(value) do
161 Value.write(self, section, table.concat(rv, "/"))