|
@@ -135,127 +135,208 @@ SCRAPER_SITE = os.getenv("EMUS_SCRAPER_SITE", "screenscraper")
|
|
|
JSON_LOGGING = os.getenv("EMUS_JSON_LOGGING", False)
|
|
|
LOG_TYPE = "json" if JSON_LOGGING else "log"
|
|
|
|
|
|
-RETROPIE_RETROARCH_WEB_SYSTEM_MAP = {
|
|
|
- "3do": "opera",
|
|
|
- "atarijaguar": "virtualjaguar",
|
|
|
- "atarilynx": "handy",
|
|
|
- "coleco": "bluemsx",
|
|
|
- "dreamcast": "flycast",
|
|
|
- "gamgear": "genesis_plus_gx",
|
|
|
- "gb": "gambatte",
|
|
|
- "gba": "mgba",
|
|
|
- "gbc": "gambatte",
|
|
|
- "gc": "dolphin",
|
|
|
- "megadrive": "genesis_plus_gx",
|
|
|
- "msx": "bluemsx",
|
|
|
- "n64": "mupen64plus_next",
|
|
|
- "nds": "desmume",
|
|
|
- "ngp": "fbneo",
|
|
|
- "ngpc": "fbneo",
|
|
|
- "nes": "nestopia",
|
|
|
- "pcengine": "mednafen_supergrafx",
|
|
|
- "psp": "ppsspp",
|
|
|
- "psx": "mednafen_psx",
|
|
|
- "saturn": "mednafen_saturn",
|
|
|
- "scummvm": "",
|
|
|
- "segacd": "genesis_plus_gx",
|
|
|
- "snes": "snes9x",
|
|
|
- "wii": "dolphin",
|
|
|
+default_level = "INFO"
|
|
|
+if DEBUG:
|
|
|
+ default_level = "DEBUG"
|
|
|
+
|
|
|
+LOG_LEVEL = os.getenv("EMUS_LOG_LEVEL", default_level)
|
|
|
+LOG_FILE_PATH = os.getenv("EMUS_LOG_FILE_PATH", "/tmp/")
|
|
|
+
|
|
|
+LOGGING = {
|
|
|
+ "version": 1,
|
|
|
+ "disable_existing_loggers": False,
|
|
|
+ "root": {"handlers": ["console", "file"], "level": LOG_LEVEL, "propagate": True},
|
|
|
+ "formatters": {
|
|
|
+ "color": {
|
|
|
+ "()": "colorlog.ColoredFormatter",
|
|
|
+ # \r returns caret to line beginning, in tests this eats the silly dot that removes
|
|
|
+ # the beautiful alignment produced below
|
|
|
+ "format": "\r"
|
|
|
+ "{log_color}{levelname:8s}{reset} "
|
|
|
+ "{bold_cyan}{name}{reset}:"
|
|
|
+ "{fg_bold_red}{lineno}{reset} "
|
|
|
+ "{thin_yellow}{funcName} "
|
|
|
+ "{thin_white}{message}"
|
|
|
+ "{reset}",
|
|
|
+ "style": "{",
|
|
|
+ },
|
|
|
+ "log": {"format": "%(asctime)s %(levelname)s %(message)s"},
|
|
|
+ "json": {
|
|
|
+ "()": "pythonjsonlogger.jsonlogger.JsonFormatter",
|
|
|
+ "format": "%(levelname)s %(name) %(funcName) %(lineno) %(asctime)s %(message)s",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "handlers": {
|
|
|
+ "console": {
|
|
|
+ "class": "logging.StreamHandler",
|
|
|
+ "formatter": "color",
|
|
|
+ "level": LOG_LEVEL,
|
|
|
+ },
|
|
|
+ "null": {
|
|
|
+ "class": "logging.NullHandler",
|
|
|
+ "level": LOG_LEVEL,
|
|
|
+ },
|
|
|
+ "file": {
|
|
|
+ "class": "logging.handlers.RotatingFileHandler",
|
|
|
+ "filename": "".join([LOG_FILE_PATH, "emus.", LOG_TYPE]),
|
|
|
+ "formatter": LOG_TYPE,
|
|
|
+ "level": LOG_LEVEL,
|
|
|
+ },
|
|
|
+ "requests_file": {
|
|
|
+ "class": "logging.handlers.RotatingFileHandler",
|
|
|
+ "filename": "".join([LOG_FILE_PATH, "emus_requests.", LOG_TYPE]),
|
|
|
+ "formatter": LOG_TYPE,
|
|
|
+ "level": LOG_LEVEL,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "loggers": {
|
|
|
+ # Quiet down our console a little
|
|
|
+ "django.channels.server": {
|
|
|
+ "handlers": ["requests_file", "console"],
|
|
|
+ "level": "ERROR",
|
|
|
+ "propagate": False,
|
|
|
+ },
|
|
|
+ "django": {
|
|
|
+ "handlers": ["file"],
|
|
|
+ "propagate": True,
|
|
|
+ },
|
|
|
+ "daphne": {"handlers": ["file"], "propagate": False},
|
|
|
+ "django.db.backends": {"handlers": ["null"]},
|
|
|
+ "emus": {"handlers": ["console", "file"], "propagate": True},
|
|
|
+ "games": {"handlers": ["console", "file"], "propagate": True},
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
+REMOVE_FROM_SLUGS = ["_", " ", "/"]
|
|
|
+
|
|
|
+if DEBUG:
|
|
|
+ # We clear out a db with lots of games all the time in dev
|
|
|
+ DATA_UPLOAD_MAX_NUMBER_FIELDS = 3000
|
|
|
+
|
|
|
GAME_SYSTEM_DEFAULTS = {
|
|
|
"3do": {
|
|
|
"name": "3DO",
|
|
|
+ "retroarch_core": "opera",
|
|
|
+ },
|
|
|
+ "3ds": {
|
|
|
+ "name": "Nintendo 3DS",
|
|
|
+ "emulator": "drastic",
|
|
|
},
|
|
|
"atarijaguar": {
|
|
|
"name": "Atari Jaguar",
|
|
|
+ "retroarch_core": "virtualjaguar",
|
|
|
},
|
|
|
"atarilynx": {
|
|
|
"name": "Atari Lynx",
|
|
|
"color": "FFBF00",
|
|
|
+ "retroarch_core": "handy",
|
|
|
},
|
|
|
"coleco": {
|
|
|
"name": "Colecovision",
|
|
|
+ "retroarch_core": "bluemsx",
|
|
|
},
|
|
|
"dreamcast": {
|
|
|
"name": "Dreamcast",
|
|
|
"color": "ED872D",
|
|
|
+ "retroarch_core": "flycast",
|
|
|
},
|
|
|
"fds": {
|
|
|
"name": "Famicom Disc System",
|
|
|
"color": "B70E30",
|
|
|
+ "retroarch_core": "genesis_plus_gx",
|
|
|
},
|
|
|
"gb": {
|
|
|
"name": "Game Boy",
|
|
|
"color": "C0B8B1",
|
|
|
+ "retroarch_core": "gambatte",
|
|
|
},
|
|
|
"gba": {
|
|
|
"name": "Game Boy Advance",
|
|
|
"color": "D5D5D5",
|
|
|
"webretro_core": "mgba",
|
|
|
+ "retroarch_core": "mgba",
|
|
|
},
|
|
|
"gbc": {
|
|
|
"name": "Game Boy Color",
|
|
|
- "color": "",
|
|
|
+ "color": "77CCFF",
|
|
|
+ "retroarch_core": "gambatte",
|
|
|
},
|
|
|
"gc": {
|
|
|
"name": "GameCube",
|
|
|
"color": "7461C7",
|
|
|
+ "emulator": "dolphin",
|
|
|
},
|
|
|
"mame-libretro": {
|
|
|
"name": "Arcade",
|
|
|
"color": "111111",
|
|
|
+ "retroarch_core": "lr-mame2003",
|
|
|
},
|
|
|
"megadrive": {
|
|
|
"name": "Genesis/Mega Drive",
|
|
|
"color": "D03737",
|
|
|
"webretro_core": "genesis_plus_gx",
|
|
|
+ "retroarch_core": "genesis_plus_gx",
|
|
|
},
|
|
|
"model3": {
|
|
|
"name": "Sega Model 3",
|
|
|
- "color": "",
|
|
|
+ "emulator": "Supermodel",
|
|
|
},
|
|
|
"gamgear": {
|
|
|
"name": "Game Gear",
|
|
|
- "color": "",
|
|
|
+ "color": "3FA3C4",
|
|
|
},
|
|
|
"msx": {
|
|
|
"name": "MSX",
|
|
|
+ "retroarch_corre": "bluemsx",
|
|
|
},
|
|
|
"n64": {
|
|
|
"name": "Nintendo 64",
|
|
|
"color": "C76660",
|
|
|
"webretro_core": "mupen64plus_next",
|
|
|
+ "retroarch_core": "mupen64plus_next",
|
|
|
},
|
|
|
"nds": {
|
|
|
"name": "Nintendo DS",
|
|
|
"color": "39D0D0",
|
|
|
+ "retroarch_core": "desmume",
|
|
|
},
|
|
|
"ngp": {
|
|
|
"name": "Neo Geo Pocket",
|
|
|
+ "retroarch_core": "fbneo",
|
|
|
},
|
|
|
"neogeo": {
|
|
|
"name": "Neo Geo",
|
|
|
+ "retroarch_core": "fbneo",
|
|
|
},
|
|
|
"ngpc": {
|
|
|
"name": "Neo Geo Pocket Color",
|
|
|
+ "retroarch_core": "fbneo",
|
|
|
+ },
|
|
|
+ "nes": {
|
|
|
+ "name": "Nintendo",
|
|
|
+ "color": "656565",
|
|
|
+ "webretro_core": "nestopia",
|
|
|
+ "retroarch_core": "nestopia",
|
|
|
},
|
|
|
- "nes": {"name": "Nintendo", "color": "656565", "webretro_core": "nestopia"},
|
|
|
"pcengine": {
|
|
|
"name": "PC Engine/TurboGrafix 16",
|
|
|
"color": "55B4CC",
|
|
|
+ "retroarch_core": "mednafen_supergrafx",
|
|
|
},
|
|
|
"ps2": {
|
|
|
"name": "Playstation 2",
|
|
|
"color": "111CAA",
|
|
|
+ "emulator": "pcsx2",
|
|
|
},
|
|
|
"psp": {
|
|
|
"name": "Playstation Portable",
|
|
|
"color": "",
|
|
|
+ "retroarch_core": "ppsspp",
|
|
|
},
|
|
|
"psx": {
|
|
|
"name": "Playstation",
|
|
|
"color": "E9DD00",
|
|
|
+ "retroarch_core": "mednafen_psx",
|
|
|
},
|
|
|
"ports": {
|
|
|
"name": "Ports",
|
|
@@ -263,108 +344,39 @@ GAME_SYSTEM_DEFAULTS = {
|
|
|
"saturn": {
|
|
|
"name": "Saturn",
|
|
|
"color": "0047AB",
|
|
|
+ "retroarch_core": "mednafen_saturn",
|
|
|
+ "emulator": "yabuse",
|
|
|
},
|
|
|
"scummvm": {
|
|
|
"name": "ScummVM",
|
|
|
"color": "E8B500",
|
|
|
+ "retroarch_core": "scummvm",
|
|
|
+ "emulator": "scummvm",
|
|
|
},
|
|
|
"sega32x": {
|
|
|
"name": "Sega 32X",
|
|
|
"color": "",
|
|
|
+ "retroarch_core": "genesis_plus_gx",
|
|
|
},
|
|
|
"segacd": {
|
|
|
"name": "Sega CD",
|
|
|
"color": "",
|
|
|
+ "retroarch_core": "genesis_plus_gx",
|
|
|
},
|
|
|
"snes": {
|
|
|
"name": "Super Nintendo",
|
|
|
"color": "A060C7",
|
|
|
+ "retroarch_core": "snes9x",
|
|
|
"webretro_core": "snes9x",
|
|
|
},
|
|
|
"virtualboy": {
|
|
|
"name": "Virtual Boy",
|
|
|
"color": "99AA11",
|
|
|
+ "retroarch_core": "virtualboy",
|
|
|
},
|
|
|
"wii": {
|
|
|
"name": "Wii",
|
|
|
"color": "",
|
|
|
+ "retroarch_core": "dolphin",
|
|
|
},
|
|
|
}
|
|
|
-
|
|
|
-default_level = "INFO"
|
|
|
-if DEBUG:
|
|
|
- default_level = "DEBUG"
|
|
|
-
|
|
|
-LOG_LEVEL = os.getenv("EMUS_LOG_LEVEL", default_level)
|
|
|
-LOG_FILE_PATH = os.getenv("EMUS_LOG_FILE_PATH", "/tmp/")
|
|
|
-
|
|
|
-LOGGING = {
|
|
|
- "version": 1,
|
|
|
- "disable_existing_loggers": False,
|
|
|
- "root": {"handlers": ["console", "file"], "level": LOG_LEVEL, "propagate": True},
|
|
|
- "formatters": {
|
|
|
- "color": {
|
|
|
- "()": "colorlog.ColoredFormatter",
|
|
|
- # \r returns caret to line beginning, in tests this eats the silly dot that removes
|
|
|
- # the beautiful alignment produced below
|
|
|
- "format": "\r"
|
|
|
- "{log_color}{levelname:8s}{reset} "
|
|
|
- "{bold_cyan}{name}{reset}:"
|
|
|
- "{fg_bold_red}{lineno}{reset} "
|
|
|
- "{thin_yellow}{funcName} "
|
|
|
- "{thin_white}{message}"
|
|
|
- "{reset}",
|
|
|
- "style": "{",
|
|
|
- },
|
|
|
- "log": {"format": "%(asctime)s %(levelname)s %(message)s"},
|
|
|
- "json": {
|
|
|
- "()": "pythonjsonlogger.jsonlogger.JsonFormatter",
|
|
|
- "format": "%(levelname)s %(name) %(funcName) %(lineno) %(asctime)s %(message)s",
|
|
|
- },
|
|
|
- },
|
|
|
- "handlers": {
|
|
|
- "console": {
|
|
|
- "class": "logging.StreamHandler",
|
|
|
- "formatter": "color",
|
|
|
- "level": LOG_LEVEL,
|
|
|
- },
|
|
|
- "null": {
|
|
|
- "class": "logging.NullHandler",
|
|
|
- "level": LOG_LEVEL,
|
|
|
- },
|
|
|
- "file": {
|
|
|
- "class": "logging.handlers.RotatingFileHandler",
|
|
|
- "filename": "".join([LOG_FILE_PATH, "emus.", LOG_TYPE]),
|
|
|
- "formatter": LOG_TYPE,
|
|
|
- "level": LOG_LEVEL,
|
|
|
- },
|
|
|
- "requests_file": {
|
|
|
- "class": "logging.handlers.RotatingFileHandler",
|
|
|
- "filename": "".join([LOG_FILE_PATH, "emus_requests.", LOG_TYPE]),
|
|
|
- "formatter": LOG_TYPE,
|
|
|
- "level": LOG_LEVEL,
|
|
|
- },
|
|
|
- },
|
|
|
- "loggers": {
|
|
|
- # Quiet down our console a little
|
|
|
- "django.channels.server": {
|
|
|
- "handlers": ["requests_file", "console"],
|
|
|
- "level": "ERROR",
|
|
|
- "propagate": False,
|
|
|
- },
|
|
|
- "django": {
|
|
|
- "handlers": ["file"],
|
|
|
- "propagate": True,
|
|
|
- },
|
|
|
- "daphne": {"handlers": ["file"], "propagate": False},
|
|
|
- "django.db.backends": {"handlers": ["null"]},
|
|
|
- "emus": {"handlers": ["console", "file"], "propagate": True},
|
|
|
- "games": {"handlers": ["console", "file"], "propagate": True},
|
|
|
- },
|
|
|
-}
|
|
|
-
|
|
|
-REMOVE_FROM_SLUGS = ["_", " ", "/"]
|
|
|
-
|
|
|
-if DEBUG:
|
|
|
- # We clear out a db with lots of games all the time in dev
|
|
|
- DATA_UPLOAD_MAX_NUMBER_FIELDS = 3000
|