-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
31 lines (22 loc) · 964 Bytes
/
server.py
File metadata and controls
31 lines (22 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from threading import Timer
import os
import webbrowser
from flask_app import app
from flask_app.controllers import overlay_controller, api_controller
from flask_app.services.db_service import init_db, sync_installed_games
from flask_app.services.library_service import scan_steam_games
from flask_app.services.steam_service import SteamService
from flask_app.services.library_service import scan_steam_games
from flask_app.services.db_service import init_db, sync_installed_games
def open_config_page():
webbrowser.open("http://127.0.0.1:5000/config")
if __name__ == "__main__":
init_db()
steam = SteamService()
installed_games = scan_steam_games()
games_with_achievements = steam.filter_games_with_achievements(installed_games)
sync_installed_games(games_with_achievements)
DEBUG = True
if (not DEBUG) or os.environ.get("WERKZEUG_RUN_MAIN") == "true":
Timer(1.0, open_config_page).start()
app.run(debug=DEBUG)