# Path: gogdb/core/normalization.py
# def normalize_system(system_name):
#     system_name = system_name.lower()
#     if system_name == "mac":
#         return "osx"
#     else:
#         return system_name


import json
import datetime
import copy
import gogdb.core.model as model
from gogdb.core.normalization import normalize_system
    else:
        return int(value)


class FallbackDict:
    def __init__(self, data, defaults):
        self.data = data
        self.defaults = defaults

    def __getitem__(self, key):
        try:
            return self.data[key]
        except KeyError:
            return copy.copy(self.defaults[key])


DEPOT_V1_DEFAULTS = {
    "gameIDs": [],
    "languages": ["Neutral"],
    #"manifest": ,
    "size": "0",
    "systems": ["Windows"],
}

def load_depot_v1(data):
    source = FallbackDict(data, DEPOT_V1_DEFAULTS)
    return model.DepotV1(
        languages = source["languages"],
        size = int(source["size"]),
        game_ids = [int(x) for x in source["gameIDs"]],

# Path: gogdb/core/normalization.py
# def normalize_system(system_name):
#     system_name = system_name.lower()
#     if system_name == "mac":
#         return "osx"
#     else:
#         return system_name


# Path: gogdb/core/buildloader.py
import json
import datetime
import copy
import gogdb.core.model as model
from gogdb.core.normalization import normalize_system

    else:
        return int(value)


class FallbackDict:
    def __init__(self, data, defaults):
        self.data = data
        self.defaults = defaults

    def __getitem__(self, key):
        try:
            return self.data[key]
        except KeyError:
            return copy.copy(self.defaults[key])


DEPOT_V1_DEFAULTS = {
    "gameIDs": [],
    "languages": ["Neutral"],
    #"manifest": ,
    "size": "0",
    "systems": ["Windows"],
}

def load_depot_v1(data):
    source = FallbackDict(data, DEPOT_V1_DEFAULTS)
    return model.DepotV1(
        languages = source["languages"],
        size = int(source["size"]),
        game_ids = [int(x) for x in source["gameIDs"]],

        system = normalize_system(source["systems"][0]),