local addonName, private = ...

private.modernize = function()
    if not private.db.global.timeline_frame then
        private.db.global.timeline_frame = {}
    end
    if private.db.profile.timeline_frame then
        private.db.global.timeline_frame = private.db.profile.timeline_frame
        private.db.profile.timeline_frame = nil
    end
    if private.db.profile.bigicon_frame then
        private.db.global.bigicon_frame = private.db.profile.bigicon_frame
        private.db.profile.bigicon_frame = nil
    end
    if private.db.profile.text_highlight_frame then
        private.db.global.text_highlight_frame = private.db.profile.text_highlight_frame
        private.db.profile.text_highlight_frame = nil
    end
    if not private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT] then
        private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT] = {}
    end

    if not private.db.profile.reminders then
        private.db.profile.reminders = {}
    end

    if not private.db.profile.editor then
        private.db.profile.editor = {}
    end
    if not private.db.profile.editor.defaultEncounterDuration then
        private.db.profile.editor.defaultEncounterDuration = 300
    end
    if private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT].height then
        private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT].travelSize = private.db.global.timeline_frame
        [private.ACTIVE_EDITMODE_LAYOUT].height
        private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT].height = nil
    end
    if not private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT].otherSize then
        private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT].otherSize = private.db.global.timeline_frame
        [private.ACTIVE_EDITMODE_LAYOUT].width
    end

    if not private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT].travel_direction then
        private.db.global.timeline_frame[private.ACTIVE_EDITMODE_LAYOUT].travel_direction = private.TIMELINE_DIRECTIONS.VERTICAL
    end

    if not private.db.profile.icon_settings then
        private.db.profile.icon_settings = {}
    end
    if not private.db.profile.icon_settings.size then
        private.db.profile.icon_settings.size = 44
    end
    if not private.db.profile.icon_settings.zoom then
        private.db.profile.icon_settings.zoom = 0.3
    end
    if not private.db.profile.icon_settings.TextOffset then
        private.db.profile.icon_settings.TextOffset = { x = 10, y = 0 }
    end
    if not private.db.profile.text_settings then
        private.db.profile.text_settings = {}
    end
    if not private.db.profile.text_settings.fontSize then
        private.db.profile.text_settings.fontSize = 14
    end
    if not private.db.profile.text_settings.font then
        private.db.profile.text_settings.font = "Friz Quadrata TT"
    end

    if not private.db.profile.text_settings.defaultColor then
        private.db.profile.text_settings.defaultColor = { r = 1, g = 1, b = 1 }
    end

    if not private.db.profile.cooldown_settings then
        private.db.profile.cooldown_settings = {}
    end

    if not private.db.profile.cooldown_settings.fontSize then
        private.db.profile.cooldown_settings.fontSize = 24
    end
    if not private.db.profile.cooldown_settings.font then
        private.db.profile.cooldown_settings.font = "Friz Quadrata TT"
    end

    if not private.db.profile.cooldown_settings.cooldown_color then
        private.db.profile.cooldown_settings.cooldown_color = {
            r = 1,
            g = 1,
            b = 1,
        }
    end

    if not private.db.profile.cooldown_settings.cooldown_highlight then
        private.db.profile.cooldown_settings.cooldown_highlight = {}
    end

    if not private.db.profile.cooldown_settings.cooldown_highlight.enabled then
        private.db.profile.cooldown_settings.cooldown_highlight.enabled = true
    end

    if not private.db.profile.cooldown_settings.cooldown_highlight.highlights then
        private.db.profile.cooldown_settings.cooldown_highlight.highlights = {
            {
                time = 3,
                color = { r = 1, g = 0, b = 0 },
                useGlow = false,
                glowType = private.GlowTypes.PROC,
                glowColor = {r= 0.95, g= 0.95, b= 0.32, a= 1 },
            },
            {
                time = 5,
                color = { r = 1, g = 1, b = 0 },
                useGlow = false,
                glowType = private.GlowTypes.PROC,
                glowColor = {r= 0.95, g= 0.95, b= 0.32, a= 1 },
            },
        }
    end
end
