Node.title is nil after vlc.sd.add_node({title="Title"})

Discuss your Lua playlist, album art and interface scripts.
BIAG Zukunft
New Cone
New Cone
Posts: 2
Joined: 04 Jul 2016 07:56

Node.title is nil after vlc.sd.add_node({title="Title"})

Postby BIAG Zukunft » 04 Jul 2016 08:26

When executing this dead-simple test script by activating the JTest service discovery (clicking on it), only the A entry will appear on the log, not the B one. The Jamendo SD scripts that shipped with my various VLC installations work fine in this regard and I really can’t spot the error. I verified this result on the nightly build dated to 2016-06-29 and version 2.2.3 or 2.2.4 (shouldn’t really matter, I guess). Any ideas? I already tried asking in IRC a few times and the only guy who responded couldn’t help me. I had it compiled with this online service and because I obtained this code by condensing and adapting the code of the 2.2.4 Jamendo SD script, I guess it might technically still be under the GPL in some way. :roll:

Code: Select all

function descriptor() return { title = "JTest", capabilities = {} } end function activate() main() end function main() local T = vlc.sd.add_node({title="Jamendo's Finest – Trending tracks playlist"}) if T == nil then return nil end log("A") if T.title == nil then return nil end log("B") end function log( msg ) vlc.msg.dbg( "[JAMENDO] " .. msg ) end
core debug: adding services_discovery lua{sd='JTest',longname='JTest'}...
core debug: looking for services_discovery module matching "lua": 8 candidates
core debug: set config option: lua-sd to JTest
core debug: set config option: lua-longname to JTest
core debug: using services_discovery module "lua"
core debug: Adding Jamendo's Finest – Trending tracks playlist in (null)
lua debug: [JAMENDO] A
lua debug: LuaSD script loaded: C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\sd\JTest.luac
core debug: meta ok for (null), need to fetch art
core debug: looking for meta fetcher module matching "any": 1 candidates
lua debug: Trying Lua scripts in C:\Users\<Username>\AppData\Roaming\vlc\lua\meta\fetcher
lua debug: Trying Lua scripts in C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\fetcher
lua debug: Trying Lua playlist script C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\fetcher\tvrage.luac
lua debug: skipping script (unmatched scope) C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\fetcher\tvrage.luac
core debug: no meta fetcher modules matched
core debug: searching art for Jamendo's Finest – Trending tracks playlist
core debug: looking for art finder module matching "any": 2 candidates
lua debug: Trying Lua scripts in C:\Users\<Username>\AppData\Roaming\vlc\lua\meta\art
lua debug: Trying Lua scripts in C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art
lua debug: Trying Lua playlist script C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\00_musicbrainz.luac
lua debug: skipping script (unmatched scope) C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\00_musicbrainz.luac
lua debug: Trying Lua playlist script C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\01_googleimage.luac
lua debug: skipping script (unmatched scope) C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\01_googleimage.luac
lua debug: Trying Lua playlist script C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\02_frenchtv.luac
lua debug: skipping script (unmatched scope) C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\02_frenchtv.luac
lua debug: Trying Lua playlist script C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\03_lastfm.luac
lua debug: skipping script (unmatched scope) C:\Dateisammlung\Programm_Install\vlc-2.2.3\lua\meta\art\03_lastfm.luac
core debug: no art finder modules matched
core debug: art not found for Jamendo's Finest – Trending tracks playlist
I guess that’s all, ask if you need anything else. :)

First edit: I should probably add that I had nearly zero exposure to Lua before I tried working on the script, however, I have quite a bit of experience in C++ and I’d claim to have decent knowledge of, err, general concepts of programming. I already successfully tweaked the default one to better fit my needs, it only broke when I pulled node creation out from add_playlist directly into main and I just can’t see why.
For reference, the default script, node creation on line 63.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Node.title is nil after vlc.sd.add_node({title="Title"})

Postby Jean-Baptiste Kempf » 04 Jul 2016 18:24

Does the jamendo script do it on a node or on an item?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

BIAG Zukunft
New Cone
New Cone
Posts: 2
Joined: 04 Jul 2016 07:56

Re: Node.title is nil after vlc.sd.add_node({title="Title"})

Postby BIAG Zukunft » 04 Jul 2016 21:59

The original/default Jamendo script doesn’t query the title at all, it just sets it upon initialization.
Does this, in converse, mean that the title property can’t be queried for nodes⁉ Quite … outlandish, to say the least.
Addition: This would also mean that the title property couldn’t be altered after node creation, if there are no serious magical provisions made for this to work.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 7 guests