add socketio to global state
This commit is contained in:
parent
bc9bf71824
commit
85854e5673
2 changed files with 8 additions and 6 deletions
|
@ -1,15 +1,15 @@
|
|||
from typing import Any
|
||||
|
||||
import dotenv
|
||||
from flask import Flask, Response, jsonify, request
|
||||
from flask_cors import CORS
|
||||
from flask_socketio import SocketIO, emit
|
||||
|
||||
from .state import State
|
||||
from .connect import get_connection
|
||||
from .room import Room
|
||||
from .song import Song, init_db, get_song_by_title_artist, add_song_in_db
|
||||
from .song_fetch import lastfm_query_search, download_song_mp3
|
||||
|
||||
from typing import Any
|
||||
from .song import Song, add_song_in_db, get_song_by_title_artist, init_db
|
||||
from .song_fetch import download_song_mp3, lastfm_query_search
|
||||
from .state import State
|
||||
|
||||
dotenv.load_dotenv()
|
||||
|
||||
|
@ -20,7 +20,7 @@ socketio = SocketIO(app)
|
|||
CORS(app)
|
||||
|
||||
db_conn = get_connection()
|
||||
state = State(app, db_conn.cursor())
|
||||
state = State(app, socketio, db_conn.cursor())
|
||||
init_db(state.db)
|
||||
|
||||
state.rooms[1000] = Room(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue