3,726
edits
MusikAnimal (talk | contribs) No edit summary |
MusikAnimal (talk | contribs) No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 103: | Line 103: | ||
if full ~= '' and full ~= nil then | if full ~= '' and full ~= nil then | ||
after_sql = ' AND tease = 0 AND abandoned = 0 AND prerecorded = 0' | after_sql = ' AND tease = 0 AND abandoned = 0 AND soundcheck = 0 AND prerecorded = 0' | ||
end | end | ||
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 246: | Line 253: | ||
'shows.location=location', | 'shows.location=location', | ||
'shows.festival=festival', | 'shows.festival=festival', | ||
'shows.notes=notes', | |||
"IF(live_show_photos._pageName IS NULL AND shows.poster IS NULL, NULL, '1')=photos", | "IF(live_show_photos._pageName IS NULL AND shows.poster IS NULL, NULL, '1')=photos", | ||
"IF(live_show_videos._pageName IS NULL, NULL, '1')=video", | "IF(live_show_videos._pageName IS NULL, NULL, '1')=video", | ||
Line 267: | 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 278: | 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 | end | ||
if options['piano'] and options['piano'] ~= ' | if options['piano'] and options['piano'] ~= 'All' then | ||
table.insert(wheres, "live_songs.piano = | table.insert(wheres, "live_songs.piano = " .. normalize_song_option(options['piano'])) | ||
end | end | ||
if options['soundcheck'] and options['soundcheck'] ~= ' | if options['soundcheck'] and options['soundcheck'] ~= 'All' then | ||
table.insert(wheres, "live_songs.soundcheck = | table.insert(wheres, "live_songs.soundcheck = " .. normalize_song_option(options['soundcheck'])) | ||
end | end | ||
if options['prerecorded'] and options['prerecorded'] ~= ' | if options['prerecorded'] and options['prerecorded'] ~= 'All' then | ||
table.insert(wheres, "live_songs.prerecorded = | table.insert(wheres, "live_songs.prerecorded = " .. normalize_song_option(options['prerecorded'])) | ||
end | end | ||
if options['vip'] and options['vip'] ~= ' | if options['vip'] and options['vip'] ~= 'All' then | ||
table.insert(wheres, "live_songs.vip = | table.insert(wheres, "live_songs.vip = " .. normalize_song_option(options['vip'])) | ||
end | |||
if options['tease'] and options['tease'] ~= 'All' then | |||
table.insert(wheres, "live_songs.tease = " .. normalize_song_option(options['tease'])) | |||
end | |||
if options['abandoned'] and options['abandoned'] ~= 'All' then | |||
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 298: | Line 314: | ||
if options['length'] and options['length'] ~= 'No' then | if options['length'] and options['length'] ~= 'No' then | ||
local secs = require('Module:Live song')._time_to_seconds(options['length']) | local secs = require('Module:Live song')._time_to_seconds(options['length']) | ||
table.insert(wheres, "live_songs. | table.insert(wheres, "live_songs.seconds >= " .. secs) | ||
end | end | ||
Line 366: | 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) | ||
Line 414: | Line 407: | ||
result['multi_song'] = '1' | result['multi_song'] = '1' | ||
end | end | ||
list:node( | local success, row_node = pcall(get_row, result) | ||
if success == false then | |||
error('Too many results! Try narrowing your search criteria') | |||
else | |||
list:node(row_node) | |||
end | |||
-- For counts | -- For counts |