Skip to content

Commit 895e203

Browse files
Music Player app: shortcuts
1 parent 4faa3b8 commit 895e203

File tree

1 file changed

+4
-1
lines changed
  • internal_filesystem/apps/com.micropythonos.musicplayer/assets

1 file changed

+4
-1
lines changed

internal_filesystem/apps/com.micropythonos.musicplayer/assets/music_player.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def onCreate(self):
2222
self.file_explorer.explorer_open_dir('M:/')
2323
self.file_explorer.align(lv.ALIGN.CENTER, 0, 0)
2424
self.file_explorer.add_event_cb(self.file_explorer_event_cb, lv.EVENT.ALL, None)
25-
self.file_explorer.explorer_set_quick_access_path(lv.EXPLORER.MUSIC_DIR, "M:/sdcard/music")
25+
import os
26+
local_filesystem_dir = os.getcwd().rstrip('/') # if it's / then it has a slash, if it's a subfolder then it doesn't
27+
self.file_explorer.explorer_set_quick_access_path(lv.EXPLORER.HOME_DIR, f"M:{local_filesystem_dir}/")
28+
self.file_explorer.explorer_set_quick_access_path(lv.EXPLORER.MUSIC_DIR, f"M:{local_filesystem_dir}/sdcard/music")
2629
self.setContentView(screen)
2730

2831
def onResume(self, screen):

0 commit comments

Comments
 (0)