local util = require('util') app.on('scan_experience', function(exp) --print_r(exp) end) app.on('scan_experience_file', function(exp) end) app.on('set', function(k,v) end) app.on('dir', function(opts) local showportals = app.opts.plugin_peertube_strategy == 'always' or (app.opts.plugin_peertube_strategy == 'homepage' and opts.isroot) if showportals then opts.data.itemsremote = opts.data.itemsremote or {} local itemsremote = opts.data.itemsremote for i=1,5 do local urls = app.opts[ 'plugin_peertube_url_' .. i] if #urls > 0 then local url = urls:gsub(' .*','') local thumburl = urls:match(" ") and urls:gsub('.* ','') or nil table.insert(itemsremote, { title = url:gsub(".*//",""), thumbnail = thumburl, url = url }) end end end end) -- this registers the plugin UI local plugin = { name = "Peertube", tab = " Peertube", info = "disabled Peertube videos/channels/livestreams can be rendered as rooms in JanusWeb", opts = { { key='app.opts.plugin_peertube_strategy', title='Display portals', info="When to show peertube portals?", default="homepage", values={always='always',homepage='only homepage'} }, { key='app.opts.plugin_peertube_url_1', title='Peertube URL 1', info="URL and/or Thumbnail URL (space separated)", default="https://tilvids.com/c/arthurpizza https://oss.iqrator.org/wp-content/uploads/2026/01/00-16-510x510.png", values='https://tilvids.com/c/arthurpizza https://oss.iqrator.org/wp-content/uploads/2026/01/00-16-510x510.png' }, { key='app.opts.plugin_peertube_url_2', title='Peertube URL 2', info="URL and/or Thumbnail URL (space separated)", default="", values='' }, { key='app.opts.plugin_peertube_url_3', title='Peertube URL 3', info="URL and/or Thumbnail URL (space separated)", default="", values='' }, { key='app.opts.plugin_peertube_url_4', title='Peertube URL 4', info="URL and/or Thumbnail URL (space separated)", default="", values='' }, { key='app.opts.plugin_peertube_url_5', title='Peertube URL 5', info="URL and/or Thumbnail URL (space separated)", default="", values='' } } } return plugin