- Added MusicPlayerService for managing VLC music playback with playlist support. - Implemented methods for loading playlists, controlling playback (play, pause, stop, next, previous), and managing volume and play modes. - Integrated real-time synchronization with VLC state using a background thread. - Added SocketIO event emissions for player state updates. - Enhanced logging for better debugging and tracking of player state changes. fix: Improve SocketIO service logging and event handling - Added detailed logging for SocketIO events and user authentication. - Implemented a test event handler to verify SocketIO functionality. - Enhanced error handling and logging for better traceability. chore: Update dependencies and logging configuration - Added python-vlc dependency for VLC integration. - Configured logging to show INFO and DEBUG messages for better visibility during development. - Updated main application entry point to allow unsafe Werkzeug for debugging purposes.
31 lines
806 B
Python
31 lines
806 B
Python
import logging
|
|
from dotenv import load_dotenv
|
|
|
|
from app import create_app, socketio
|
|
|
|
# Load environment variables from .env file
|
|
load_dotenv()
|
|
|
|
# Configure logging to show all INFO and DEBUG messages
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
|
datefmt='%H:%M:%S'
|
|
)
|
|
|
|
# Set specific loggers to DEBUG for detailed SocketIO and music player logs
|
|
logging.getLogger('app.services.socketio_service').setLevel(logging.DEBUG)
|
|
logging.getLogger('app.services.music_player_service').setLevel(logging.INFO)
|
|
|
|
|
|
def main() -> None:
|
|
"""Run the Flask application with SocketIO."""
|
|
app = create_app()
|
|
socketio.run(
|
|
app, debug=True, host="0.0.0.0", port=5000, allow_unsafe_werkzeug=True
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|