3,726
edits
MusikAnimal (talk | contribs) No edit summary |
MusikAnimal (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local cargo = mw.ext.cargo | local cargo = mw.ext.cargo | ||
local multi_song = false | |||
local function get_keys(t) | local function get_keys(t) | ||
Line 257: | Line 258: | ||
-- live_songs options | -- live_songs options | ||
if options['songs'] then | if options['songs'] then | ||
local songs = mw.text.split(options['songs'], ';', true) | local songs = mw.text.split(options['songs'], ';', true) | ||
multi_song = #songs > 1 | |||
local songWheres = {} | local songWheres = {} | ||
for r = 1, #songs do | for r = 1, #songs do | ||
Line 267: | Line 267: | ||
table.insert(wheres, "(" .. table.concat(songWheres, ' OR ') .. ")") | table.insert(wheres, "(" .. table.concat(songWheres, ' OR ') .. ")") | ||
end | end | ||
if options['show_songs'] or | if options['show_songs'] or multi_song or options['grouping'] == 'Group by song' then | ||
table.insert(groups, "live_songs._ID") | table.insert(groups, "live_songs._ID") | ||
table.insert(fields, "live_songs.name=song") | table.insert(fields, "live_songs.name=song") | ||
Line 410: | Line 410: | ||
for r = 1, #results do | for r = 1, #results do | ||
local result = results[r] | local result = results[r] | ||
if multi_song then | |||
result['multi_song'] = '1' | |||
end | |||
list:node(get_row(result)) | list:node(get_row(result)) | ||