Tuan Nguyen пре 11 месеци
родитељ
комит
f04f9c059b
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      dune_weaver_flask/app.py
  2. 1 1
      dune_weaver_flask/modules/core/playlist_manager.py

+ 1 - 1
dune_weaver_flask/app.py

@@ -45,7 +45,7 @@ def connect():
         return jsonify({'success': True})
 
     try:
-        state.conn = SerialConnection(port)
+        state.conn = connection_manager.SerialConnection(port)
         logger.info(f'Successfully connected to serial port {port}')
         return jsonify({'success': True})
     except Exception as e:

+ 1 - 1
dune_weaver_flask/modules/core/playlist_manager.py

@@ -12,7 +12,7 @@ logger = logging.getLogger(__name__)
 PLAYLISTS_FILE = os.path.join(os.getcwd(), "playlists.json")
 
 # Ensure the file exists and contains at least an empty JSON object
-if not os.path.exists(PLAYLISTS_FILE):
+if not os.path.isfile(PLAYLISTS_FILE):
     logger.info(f"Creating new playlists file at {PLAYLISTS_FILE}")
     with open(PLAYLISTS_FILE, "w") as f:
         json.dump({}, f, indent=2)