diff --git a/src/media_player.py b/src/media_player.py index 7d30aa4..44ecc9e 100644 --- a/src/media_player.py +++ b/src/media_player.py @@ -67,7 +67,7 @@ class MediaPlayer(Screen): Logger.error(f"Failed to load playlist: {e}") def download_media_files(self): - base_dir = '/home/pi/media/files' # Update this to a directory with write permissions + base_dir = os.path.join(os.path.dirname(__file__), 'static', 'resurse') # Update this to the correct path if not os.path.exists(base_dir): os.makedirs(base_dir) @@ -95,7 +95,7 @@ class MediaPlayer(Screen): duration = media.get('duration', 10) # Default duration is 10 seconds # Define the base directory for media files - base_dir = '/path/to/media/files' # Update this to the correct path + base_dir = os.path.join(os.path.dirname(__file__), 'static', 'resurse') # Update this to the correct path file_path = os.path.join(base_dir, file_name) if file_extension in ['.mp4', '.avi', '.mov']: