跳到内容

Module:沙盒/Economy666/SongCollectionMulti:修订间差异

无编辑摘要
无编辑摘要
无编辑摘要
第36行: 第36行:
end
end


local function artistLink(artist)
local cal = mw.loadJsonData 'Template:ComplexArtistsList.json'
local trans = mw.loadJsonData 'Template:Transition.json'
 
local function link(l, d)
   if d then
     return '[[' .. l .. '|' .. d .. ']]'
   else
     return '[[' .. l .. ']]'
   end
end
end
local onlyMobile = frame:expandTemplate{title = '仅', args = {'移动版', '', '图片角标'}}
local onlyNS = frame:expandTemplate{title = '仅', args = {'NS版', '', '图片角标'}}


local sectionCode = {unknown = 0, free = 1, archive = 2, mainstory = 3, sidestory = 4, collab = 5, single = 6}
local sectionCode = {unknown = 0, free = 1, archive = 2, mainstory = 3, sidestory = 4, collab = 5, single = 6}
第93行: 第103行:
data:insert(input '标题' or table.concat({'[[' .. mad.linkTitle(song) .. ']]', unpack(otherTitles(song))}, '<br>'))
data:insert(input '标题' or table.concat({'[[' .. mad.linkTitle(song) .. ']]', unpack(otherTitles(song))}, '<br>'))
local cal = mw.loadJsonData 'Template:ComplexArtistsList.json'
local artist = cal[string.gsub(song.artist, ' ' , '') ]
local artist = cal[string.gsub(song.artist, ' ' , '') ]
if not artist then
if not artist then
第104行: 第113行:
data:insert(input '音乐家' or artist)
data:insert(input '音乐家' or artist)
local pack_main = packItem['name']
local cc = 'Collaboration %- Collaboration'
local function link(v) return '[['.. v ..']]' end
local ccl = 'Collaboration#Collaboration'
local onlyMobile = frame:expandTemplate{title = ' ', args = {' 移动版', '', '图片角标'}}
local ccd = 'Collaboration'
local onlyNS = frame:expandTemplate{title = '仅', args = {'NS版', '', '图片角标'}}
local pack_main = string.gsub(trans.packName[song.set] or packItem['name'], cc, ccl)
local pack_md = string.gsub(pack_main, ccl, ccd)
if mobile_id[id] and ns_id[id] then
if mobile_id[id] and ns_id[id] then
packItem_ns = mad.packQueryWrap(ns_song[id].set, 'ns')
packItem_ns = mad.packQueryWrap(ns_song[id].set, 'ns')
local pack_ns = packItem_ns['name']
local pack_ns = string.gsub(trans.packName[ns_song[id].set] or packItem_ns['name'], cc, ccl)
local pack_nd = string.gsub(pack_ns, ccl, ccd)
if pack_ns == pack_main then
if pack_ns == pack_main then
pack = link(pack_main)
pack = link(pack_main, pack_md)
else
else
pack = link(pack_main) .. onlyMobile .. '<br \>' ..link(pack_ns) .. onlyNS
pack = link(pack_main, pack_md) .. onlyMobile .. '<br \>' ..link(pack_ns, pack_nd) .. onlyNS
end
end
elseif mobile_id[id] then
elseif mobile_id[id] then
pack = link(pack_main) .. onlyMobile
pack = link(pack_main, pack_md) .. onlyMobile
else 
else 
pack = link(pack_main) .. onlyNS
pack = link(pack_main, pack_md) .. onlyNS
end
end


918

个编辑