跳至內容

「Module:沙盒/Economy666/Memory Archive NS」:修訂間差異

無編輯摘要
(t)
 
無編輯摘要
行 7: 行 7:
    local dot = frame:expandTemplate {title = '·'}
    local dot = frame:expandTemplate {title = '·'}
    
    
    local categories = {'poprec', 'partner', 'original', 'variety', 'musicgames'}
    local categories = {'poprec', 'partner', 'original', 'variety', 'musicgames', '其他'}
    local getCategory = {}
    local getCategory = {}
    for i = 1, 5 do
    for i = 1, 6 do
      getCategory[categories[i]] = i
      getCategory[categories[i]] = i
    end
    end
    
    
    local songs = {}
    local songs = {}
    for i = 1, 5 do
    for i = 1, 6 do
      songs[i] = {ns = {}}
      songs[i] = {ns = {}}
    end
    end
行 26: 行 26:
    
    
    for i, v in ipairs(songlist) do
    for i, v in ipairs(songlist) do
      if v.set == 'single' and nsId[v.id] then
      if v.set == 'single' then
        local cate = getCategory[v.category]
        local cate = getCategory[v.category]
        songs[cate].ns[#songs[cate].ns + 1] = v
        if not cate and nsId[v.id] then
         cate = 6  -- 将没有分类的歌曲放入 "其他" 分类
       end
       if cate then
         songs[cate].ns[#songs[cate].ns + 1] = v
       end
      end
      end
    end
    end
    
    
    local categoryNames = {'流行/推荐', '搭档', '原创', '综合', '音乐游戏'}
    local categoryNames = {'流行/推荐', '搭档', '原创', '综合', '音乐游戏', '其他'}
    local final = {}
    local final = {}
    for i, v in pairs(frame.args) do
    for i, v in pairs(frame.args) do
行 49: 行 54:
    end
    end


    for i = 1, 5 do
    for i = 1, 6 do
      local list = expand(songs[i].ns)
      local list = expand(songs[i].ns)
      final['group' .. i] = categoryNames[i]
      final['group' .. i] = categoryNames[i]
970

次編輯