无编辑摘要
无编辑摘要
 
(未显示同一用户的4个中间版本)
第371行: 第371行:
             local currentValue = ValueFromValuesByKey(songEntry, conditionField)
             local currentValue = ValueFromValuesByKey(songEntry, conditionField)
             local match = false
             local match = false
 
           
             if isPackFilter and type(currentValue) == 'string' and type(conditionValue) == 'string' then
            -- 1. 数字和布尔值的精确匹配
                 -- Pack Filter: 使用解析后的值进行不区分大小写的比较
             if currentValue == conditionValue then
                 if string.upper(currentValue) == string.upper(resolvedConditionValue) then
                match = true
                     match = true
           
            -- 2. 字符串匹配
            elseif type(currentValue) == 'string' and type(conditionValue) == 'string' then
               
                 -- 2a. Pack 字段: 缩写解析后的精确匹配 (Case-insensitive Exact Match)
                 if isPackFilter then
                    local targetValue = resolvedConditionValue -- 这会是完整的包名或原始输入
                   
                    if string.upper(currentValue) == string.upper(targetValue) then
                        match = true
                     end
               
                -- 2b. 其他字符串字段: 模糊匹配 (Case-insensitive Fuzzy Match)
                else
                    local searchString = conditionValue
                   
                    -- 模糊匹配:只要 currentValue 包含 searchString(不区分大小写)
                    if string.find(string.upper(currentValue), string.upper(searchString), 1, true) then
                        match = true
                    end
                 end
                 end
            elseif currentValue == conditionValue then
                -- Standard Match (用于非 pack 字符串、数字、布尔值)
                match = true
             end
             end


第395行: 第411行:


     local output = {}
     local output = {}
   
    -- 检查是否需要禁用宽度设置
    local disableWidths = (#displayFields <= 8)
      
      
     -- 表格样式
     -- 表格样式
第409行: 第428行:
         local separator = ' ' -- 默认分隔符是空格
         local separator = ' ' -- 默认分隔符是空格
          
          
         -- BPM/Pack/Key/Duration 字段,固定宽度 6%
         if not disableWidths then -- 宽度要求失效检查
        if field == 'bpm' or field == 'pack' or field == 'key' or field == 'duration' then  
            -- BPM/Key/Duration 字段,固定宽度 6%
            headerStyle = ' style="width: 6%;"'
            if field == 'bpm' or field == 'key' or field == 'duration' then
            separator = ' | '  
                headerStyle = ' style="width: 6%;"'
        elseif mode then -- 谱面难度字段 (3.2% 固定宽度)
                separator = ' | '  
            headerStyle = ' style="width: 3.2%;"'
            -- Pack 字段,固定宽度 10%
            separator = ' | '  
            elseif field == 'pack' then
        elseif string.match(field, '_notes$') then -- NOTES 字段 (4% 固定宽度)
                headerStyle = ' style="width: 10%;"'
            headerStyle = ' style="width: 4%;"'
                separator = ' | '  
            separator = ' | '  
            elseif mode then -- 谱面难度字段 (3.2% 固定宽度)
                headerStyle = ' style="width: 3.2%;"'
                separator = ' | '  
            elseif string.match(field, '_notes$') then -- NOTES 字段 (4% 固定宽度)
                headerStyle = ' style="width: 4%;"'
                separator = ' | '  
            end
         end
         end
          
          
第450行: 第475行:
             end
             end
              
              
             -- *** NOTES 字段样式逻辑 (包含 sc_notes 默认颜色) ***
             -- *** NOTES 字段样式逻辑 (包含 _sc_notes 默认颜色) ***
             if string.match(field, '_notes$') then  
             if string.match(field, '_notes$') then  
                 local numValue = tonumber(rawValue)
                 local numValue = tonumber(rawValue)
第458行: 第483行:
                     -- 高优先级:应用红/紫色的 formatNotesValue  
                     -- 高优先级:应用红/紫色的 formatNotesValue  
                     formattedValue = formatNotesValue(formattedValue, 'table')  
                     formattedValue = formatNotesValue(formattedValue, 'table')  
                 -- 2. 检查是否为 sc_notes 且为低优先级(< 2000)
                 -- 2. 检查是否为所有 _sc_notes 字段且为低优先级(< 2000)
                 elseif field == 'sc_notes' then
                 elseif string.match(field, '_sc_notes$') then
                     -- sc_notes 默认颜色:3d66ff (如果值不是高优先级)
                     -- sc_notes 默认颜色:3d66ff (如果值不是高优先级)
                     formattedValue = '<span style="color: #3d66ff;">' .. formattedValue .. '</span>'
                     formattedValue = '<span style="color: #3d66ff;">' .. formattedValue .. '</span>'