-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from zurdi15/develop
v1.5
- Loading branch information
Showing
25 changed files
with
573 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,7 @@ envs.env | |
mariadb | ||
|
||
# data test | ||
library | ||
library | ||
|
||
# config test | ||
romm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ requests==2.28.2 | |
fastapi==0.92.0 | ||
uvicorn==0.20.0 | ||
mariadb==1.1.6 | ||
SQLAlchemy==2.0.7 | ||
SQLAlchemy==2.0.7 | ||
PyYAML==6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
import pathlib | ||
import yaml | ||
from yaml.loader import SafeLoader | ||
|
||
|
||
# Uvicorn | ||
DEV_PORT: int = 5000 | ||
DEV_HOST: str = "0.0.0.0" | ||
|
||
# PATHS | ||
LIBRARY_BASE_PATH: str = f"{pathlib.Path(__file__).parent.parent.parent.parent.resolve()}/library" | ||
ROMM_USER_CONFIG_PATH: str = f"{pathlib.Path(__file__).parent.parent.parent.parent.resolve()}/romm/config.yml" | ||
|
||
# ROMM RESERVED FOLDERS | ||
RESERVED_FOLDERS: list = ['resources', 'database'] | ||
|
||
# DEFAULT RESOURCES | ||
DEFAULT_URL_COVER_L: str = "https://images.igdb.com/igdb/image/upload/t_cover_big/nocover.png" | ||
DEFAULT_PATH_COVER_L: str = f"/assets/library/resources/default/cover_l.png" | ||
DEFAULT_URL_COVER_S: str = "https://images.igdb.com/igdb/image/upload/t_cover_small/nocover.png" | ||
DEFAULT_PATH_COVER_S: str = f"/assets/library/resources/default/cover_s.png" | ||
|
||
# IGDB | ||
CLIENT_ID: str = os.getenv('CLIENT_ID') | ||
CLIENT_SECRET: str = os.getenv('CLIENT_SECRET') | ||
# STEAMGRIDDB | ||
STEAMGRIDDB_API_KEY: str = os.getenv('STEAMGRIDDB_API_KEY') | ||
|
||
# USER CONFIG | ||
try: | ||
with open(ROMM_USER_CONFIG_PATH) as config: config = yaml.load(config, Loader=SafeLoader) | ||
except FileNotFoundError: | ||
config = None | ||
user_config: dict = {} if not config else config | ||
|
||
# DB DRIVERS | ||
SUPPORTED_DB_DRIVERS: list = ['sqlite', 'mariadb'] | ||
ROMM_DB_DRIVER: str = os.getenv('ROMM_DB_DRIVER', 'sqlite') |
33 changes: 2 additions & 31 deletions
33
backend/src/config/config.py → backend/src/config/config_loader.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from handler.db_handler import DBHandler | ||
from handler.igdb_handler import IGDBHandler | ||
from handler.sgdb_handler import SGDBHandler | ||
|
||
igdbh: IGDBHandler = IGDBHandler() | ||
sgdbh: SGDBHandler = SGDBHandler() | ||
dbh: DBHandler = DBHandler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.