Tuan Nguyen 11 месяцев назад
Родитель
Сommit
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})
         return jsonify({'success': True})
 
 
     try:
     try:
-        state.conn = SerialConnection(port)
+        state.conn = connection_manager.SerialConnection(port)
         logger.info(f'Successfully connected to serial port {port}')
         logger.info(f'Successfully connected to serial port {port}')
         return jsonify({'success': True})
         return jsonify({'success': True})
     except Exception as e:
     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")
 PLAYLISTS_FILE = os.path.join(os.getcwd(), "playlists.json")
 
 
 # Ensure the file exists and contains at least an empty JSON object
 # 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}")
     logger.info(f"Creating new playlists file at {PLAYLISTS_FILE}")
     with open(PLAYLISTS_FILE, "w") as f:
     with open(PLAYLISTS_FILE, "w") as f:
         json.dump({}, f, indent=2)
         json.dump({}, f, indent=2)