diff options
author | Mika Havela <mika.havela@gmail.com> | 2012-03-07 12:15:44 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2012-03-07 12:15:44 +0000 |
commit | 09401b9a860e29c8401936a08468f400f31223e3 (patch) | |
tree | 6b14e91e119bac697ebc7d431835375d4d38fafe | |
parent | 00e3c8dc0c4c3f22b0b9173a215f276dcc659bfc (diff) | |
download | acf-vlc-daemon-09401b9a860e29c8401936a08468f400f31223e3.tar.bz2 acf-vlc-daemon-09401b9a860e29c8401936a08468f400f31223e3.tar.xz |
Bugfix on viewing logfiles.
Now acf tries to figure out if a logfile is specified in the configfile
-rw-r--r-- | vlc-model.lua | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/vlc-model.lua b/vlc-model.lua index d2fe0cb..3e6e5f3 100644 --- a/vlc-model.lua +++ b/vlc-model.lua @@ -38,26 +38,16 @@ function getconfigfile() return modelfunctions.getfiledetails(configfile) end -get_filedetails = function (path) +function get_filedetails() local path=logfile - for line in string.gmatch(fs.read_file(configfile), "(.-)\n") do - path=string.match(line,"^VLC_OPTS.*%-%-logfile%s+(%S+)") or path - end - - - local file = path - local st = fs.stat(path) - if st and st.type then - while st.type == "link" do - st = fs.stat(posix.readlink(st.path)) + local path2 + if fs.is_file(configfile) then + for line in string.gmatch(fs.read_file(configfile) or "", "(.-)\n") do + path2=string.match(line,"^VLC_OPTS.*--logfile%s+(%S+)") or path2 end - file = st.path end - - local filedetails = modelfunctions.getfiledetails(file) - filedetails.value.filename.value = path - - return filedetails + if path2 then path=path2 end + return modelfunctions.getfiledetails(path) end function setconfigfile(filedetails) |