Line 1: |
Line 1: |
| + | local U = require('Module:Core') |
| local Utils = require('Module:Core') | | local Utils = require('Module:Core') |
| local format = require('Module:Core').format | | local format = require('Module:Core').format |
Line 6: |
Line 7: |
| local seiyuus = require('Module:Collection/Seiyuus') | | local seiyuus = require('Module:Collection/Seiyuus') |
| local types = require('Module:Collection/ShipsByType') | | local types = require('Module:Collection/ShipsByType') |
| + | |
| + | local function requireSeasonModule(name) |
| + | local success, data = U.requireModule('Data/Season/' .. name) |
| + | if not success then |
| + | success, data = U.requireModule('Seasonal/' .. name) |
| + | end |
| + | if not success then |
| + | data = {index = {}, ships = {}} |
| + | end |
| + | return data |
| + | end |
| | | |
| function findType(ship) | | function findType(ship) |
Line 80: |
Line 92: |
| string.format([=[!colspan="5"|From [[Seasonal/%s|%s]]]=], season, season) | | string.format([=[!colspan="5"|From [[Seasonal/%s|%s]]]=], season, season) |
| } | | } |
− | local seasonal_data = require(string.format("Module:Seasonal/%s", season)) | + | local seasonal_data = requireSeasonModule(season) |
| for _, ship in ipairs(seasonal_data.index[type]) do | | for _, ship in ipairs(seasonal_data.index[type]) do |
| if only and Utils.find(args, ship) or not only and not Utils.find(args, ship) then | | if only and Utils.find(args, ship) or not only and not Utils.find(args, ship) then |