local _AddonName, _EchoRaidTools = ...;


local module = _EchoRaidTools:GetModule("todo-list")

module.lsm = {}

local lsm = LibStub("LibSharedMedia-3.0");


lsm:Register("statusbar", "Gradient", "Interface\\Addons\\EchoRaidTools\\assets\\textures\\gradient32x32")
local mediaTypes = lsm.MediaType



function module.lsm:GetBorderPath(name)
    return lsm:Fetch("border", name)
end

function module.lsm:GetFontPath(name)
    return lsm:Fetch("font", name)
end

function module.lsm:GetBackgroundPath(name)
    return lsm:Fetch("background", name)
end

function module.lsm:GetStatusbarPath(name)
    for key, t in pairs({ lsm.MediaTable.statusbar, lsm.MediaTable.statusbar_atlas or {} }) do
        local texturePath = t[name]
        if texturePath then
            return texturePath, key
        end
    end

    return lsm:Fetch("statusbar", name)
end

function module.lsm:GetBorders()
    return lsm:List("border")
end

function module.lsm:GetFonts()
    return lsm:List("font")
end

function module.lsm:GetBackgrounds()
    return lsm:List("background")
end

function module.lsm:GetStatusbars()
    local ret = {}
    for i, types in ipairs({ lsm:List("statusbar"), lsm:List("statusbar_atlas") or {} }) do
        for j, textureName in ipairs(types) do
            table.insert(ret, textureName)
        end
    end
    return ret
end

--lsm:Fetch(mediaType)

--lsm:List(mediaType)
