summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-minidlna
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-04-09 13:12:25 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-04-09 13:12:25 +0000
commitcd456ff616e0c2c18afef2753c01b957bd3a66e2 (patch)
treec797c35537c5a69388b92542b4949cc23c77a279 /applications/luci-minidlna
parentdd0fe4e12eedc8eb9c7000c51cac5d8da59c00c3 (diff)
applications/luci-minidlna: fix possible nil indexing if album art option is unset, only show one filename in placeholder
Diffstat (limited to 'applications/luci-minidlna')
-rw-r--r--applications/luci-minidlna/luasrc/model/cbi/minidlna.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua b/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
index 7c9f4dee1..41e2826ee 100644
--- a/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
+++ b/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
@@ -143,16 +143,23 @@ s:taboption("general", DynamicList, "media_dir", translate("Media directories:")
o = s:taboption("general", DynamicList, "album_art_names", translate("Album art names:"),
translate("This is a list of file names to check for when searching for album art."))
o.rmempty = true
-o.placeholder = "Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg"
+o.placeholder = "Cover.jpg"
function o.cfgvalue(self, section)
local rv = { }
+
local val = Value.cfgvalue(self, section)
- if type(val) == "table" then val = table.concat(val, "/") end
+ if type(val) == "table" then
+ val = table.concat(val, "/")
+ elseif not val then
+ val = ""
+ end
+
local file
for file in val:gmatch("[^/%s]+") do
rv[#rv+1] = file
end
+
return rv
end