Line 366: |
Line 366: |
| if not Utils.find(args, ship) then | | if not Utils.find(args, ship) then |
| local ship_data = seasonal_data.ships[ship] | | local ship_data = seasonal_data.ships[ship] |
− | for i, quote in ipairs(ship_data) do | + | local quotes = Utils.ifilter(ship_data, function(quote) |
− | if not Utils.find(args, string.format("%s/%s", ship, quote.line or "")) then | + | return not Utils.find(args, string.format("%s/%s", ship, quote.line or "")) |
− | table.insert(result, format{
| + | end) |
− | quote_template,
| + | for i, quote in ipairs(quotes) do |
− | id_string = i > 1 and "" or format{
| + | table.insert(result, format{ |
− | id_string_template,
| + | quote_template, |
− | ship = ship,
| + | id_string = i > 1 and "" or format{ |
− | },
| + | id_string_template, |
− | ship_row = i > 1 and "" or format{
| |
− | ship_row_template,
| |
− | rowspan = #ship_data,
| |
− | ship = ship,
| |
− | },
| |
| ship = ship, | | ship = ship, |
− | season = quote.season or season, | + | }, |
− | line = quote.line and " " .. quote.line or "",
| + | ship_row = i > 1 and "" or format{ |
− | ja = quote.ja or "",
| + | ship_row_template, |
− | en = quote.en or "",
| + | rowspan = #quotes, |
− | note = (quote.line and "''" .. quote.line .. "''<br>" or "") .. (quote.note or ""),
| + | ship = ship, |
− | })
| + | }, |
− | end
| + | ship = ship, |
| + | season = quote.season or season, |
| + | line = quote.line and " " .. quote.line or "", |
| + | ja = quote.ja or "", |
| + | en = quote.en or "", |
| + | note = (quote.line and "''" .. quote.line .. "''<br>" or "") .. (quote.note or ""), |
| + | }) |
| end | | end |
| end | | end |