2 LuCI - Lua Configuration Interface - miniDLNA support
4 Copyright 2012 Gabor Juhos <juhosg@openwrt.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
17 m = Map("minidlna", translate("miniDLNA"),
18 translate("MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP-AV clients."))
20 m:section(SimpleSection).template = "minidlna_status"
22 s = m:section(TypedSection, "minidlna", "miniDLNA Settings")
26 s:tab("general", translate("General Settings"))
27 s:tab("advanced", translate("Advanced Settings"))
29 o = s:taboption("general", Flag, "enabled", translate("Enable:"))
32 function o.cfgvalue(self, section)
33 return luci.sys.init.enabled("minidlna") and self.enabled or self.disabled
36 function o.write(self, section, value)
38 luci.sys.init.enable("minidlna")
39 luci.sys.call("/etc/init.d/minidlna start >/dev/null")
41 luci.sys.call("/etc/init.d/minidlna stop >/dev/null")
42 luci.sys.init.disable("minidlna")
45 return Flag.write(self, section, value)
48 o = s:taboption("general", Value, "port", translate("Port:"),
49 translate("Port for HTTP (descriptions, SOAP, media transfer) traffic."))
54 o = s:taboption("general", Value, "interface", translate("Interfaces:"),
55 translate("Network interfaces to serve."))
57 o.template = "cbi/network_ifacelist"
61 function o.cfgvalue(self, section)
63 local val = Value.cfgvalue(self, section)
66 for ifc in val:gmatch("[^,%s]+") do
73 function o.write(self, section, value)
76 for ifc in luci.util.imatch(value) do
79 Value.write(self, section, table.concat(rv, ","))
83 o = s:taboption("general", Value, "friendly_name", translate("Friendly name:"),
84 translate("Set this if you want to customize the name that shows up on your clients."))
86 o.placeholder = "OpenWrt DLNA Server"
88 o = s:taboption("advanced", Value, "db_dir", translate("Database directory:"),
89 translate("Set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache."))
91 o.placeholder = "/var/cache/minidlna"
93 o = s:taboption("advanced", Value, "log_dir", translate("Log directory:"),
94 translate("Set this if you would like to specify the directory where you want MiniDLNA to store its log file."))
96 o.placeholder = "/var/log"
98 s:taboption("advanced", Flag, "inotify", translate("Enable inotify:"),
99 translate("Set this to enable inotify monitoring to automatically discover new files."))
101 s:taboption("advanced", Flag, "enable_tivo", translate("Enable TIVO:"),
102 translate("Set this to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO."))
105 o = s:taboption("advanced", Flag, "strict_dlna", translate("Strict to DLNA standard:"),
106 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."))
109 o = s:taboption("advanced", Value, "presentation_url", translate("Presentation URL:"))
111 o.placeholder = "http://192.168.1.1/"
113 o = s:taboption("advanced", Value, "notify_interval", translate("Notify interval:"),
114 translate("Notify interval in seconds."))
115 o.datatype = "uinteger"
118 o = s:taboption("advanced", Value, "serial", translate("Announced serial number:"),
119 translate("Serial number the miniDLNA daemon will report to clients in its XML description."))
120 o.placeholder = "12345678"
122 s:taboption("advanced", Value, "model_number", translate("Announced model number:"),
123 translate("Model number the miniDLNA daemon will report to clients in its XML description."))
126 o = s:taboption("advanced", Value, "minissdpsocket", translate("miniSSDP socket:"),
127 translate("Specify the path to the MiniSSDPd socket."))
129 o.placeholder = "/var/run/minissdpd.sock"
131 o = s:taboption("general", ListValue, "root_container", translate("Root container:"))
132 o:value(".", translate("Standard container"))
133 o:value("B", translate("Browse directory"))
134 o:value("M", translate("Music"))
135 o:value("V", translate("Video"))
136 o:value("P", translate("Pictures"))
139 s:taboption("general", DynamicList, "media_dir", translate("Media directories:"),
140 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."))
143 o = s:taboption("general", DynamicList, "album_art_names", translate("Album art names:"),
144 translate("This is a list of file names to check for when searching for album art."))
146 o.placeholder = "Cover.jpg"
148 function o.cfgvalue(self, section)
151 local val = Value.cfgvalue(self, section)
152 if type(val) == "table" then
153 val = table.concat(val, "/")
159 for file in val:gmatch("[^/%s]+") do
166 function o.write(self, section, value)
169 for file in luci.util.imatch(value) do
172 Value.write(self, section, table.concat(rv, "/"))