3,726
edits
MusikAnimal (talk | contribs) No edit summary |
MusikAnimal (talk | contribs) No edit summary |
||
Line 231: | Line 231: | ||
local artist = frame.args[3] | local artist = frame.args[3] | ||
return p._main(song, longest, artist) | return p._main(song, longest, artist) | ||
end | |||
local function normalize_song_option(value) | |||
if value:sub(1, 7) == 'Include' then | |||
return 1 | |||
end | |||
return 0 | |||
end | end | ||
Line 268: | Line 275: | ||
table.insert(wheres, "(" .. table.concat(songWheres, ' OR ') .. ")") | table.insert(wheres, "(" .. table.concat(songWheres, ' OR ') .. ")") | ||
end | end | ||
if options[' | if multi_song or (options['songs'] and options['grouping'] == 'Group by song') then | ||
table.insert(groups, "live_songs._ID") | table.insert(groups, "live_songs._ID") | ||
end | |||
if options['songs'] then | |||
table.insert(fields, "live_songs.name=song") | table.insert(fields, "live_songs.name=song") | ||
table.insert(fields, "live_songs.acoustic=acoustic") | table.insert(fields, "live_songs.acoustic=acoustic") | ||
Line 279: | Line 288: | ||
table.insert(fields, "live_songs.soundcheck=soundcheck") | table.insert(fields, "live_songs.soundcheck=soundcheck") | ||
end | end | ||
if options['acoustic'] and options['acoustic'] ~= ' | if options['acoustic'] and options['acoustic'] ~= 'All' then | ||
table.insert(wheres, "live_songs.acoustic = | table.insert(wheres, "live_songs.acoustic = " .. normalize_song_option(options['acoustic'])) | ||
end | |||
if options['piano'] and options['piano'] ~= 'All' then | |||
table.insert(wheres, "live_songs.piano = " .. normalize_song_option(options['piano'])) | |||
end | |||
if options['soundcheck'] and options['soundcheck'] ~= 'All' then | |||
table.insert(wheres, "live_songs.soundcheck = " .. normalize_song_option(options['soundcheck'])) | |||
end | end | ||
if options[' | if options['prerecorded'] and options['prerecorded'] ~= 'All' then | ||
table.insert(wheres, "live_songs. | table.insert(wheres, "live_songs.prerecorded = " .. normalize_song_option(options['prerecorded'])) | ||
end | end | ||
if options[' | if options['vip'] and options['vip'] ~= 'All' then | ||
table.insert(wheres, "live_songs. | table.insert(wheres, "live_songs.vip = " .. normalize_song_option(options['vip'])) | ||
end | end | ||
if options[' | if options['tease'] and options['tease'] ~= 'All' then | ||
table.insert(wheres, "live_songs. | table.insert(wheres, "live_songs.tease = " .. normalize_song_option(options['tease'])) | ||
end | end | ||
if options[' | if options['abandoned'] and options['abandoned'] ~= 'All' then | ||
table.insert(wheres, "live_songs. | table.insert(wheres, "live_songs.abandoned = " .. normalize_song_option(options['abandoned'])) | ||
end | end | ||
if options['cover_artist'] and options['cover_artist'] ~= 'No' then | if options['cover_artist'] and options['cover_artist'] ~= 'No' then | ||
Line 367: | Line 382: | ||
local getArgs = require('Module:Arguments').getArgs | local getArgs = require('Module:Arguments').getArgs | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
local results = p._query(args) | local results = p._query(args) |