Skip to content

Commit

Permalink
Make directory when None exist for downloads
Browse files Browse the repository at this point in the history
Signed-off-by: arctic4161 <[email protected]>
  • Loading branch information
Arctic4161 committed Aug 19, 2024
1 parent a3c649d commit 36e49b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
request_permissions([Permission.INTERNET, Permission.FOREGROUND_SERVICE, Permission.MEDIA_CONTENT_CONTROL,
Permission.READ_MEDIA_AUDIO, Permission.POST_NOTIFICATIONS])
else:
os.makedirs(os.path.join(os.path.expanduser('~/Documents'), 'Youtube Music Player', 'Downloaded'), exist_ok=True)
os.environ["KIVY_HOME"] = os.path.join(os.path.expanduser('~/Documents'), 'Youtube Music Player', 'Downloaded')
os.environ['KIVY_AUDIO'] = 'gstplayer'
#os.environ["KIVY_NO_CONSOLELOG"] = "1"
os.environ["KIVY_NO_CONSOLELOG"] = "1"
from oscpy.client import OSCClient
from oscpy.server import OSCThreadServer
from kivy import platform
Expand Down Expand Up @@ -57,11 +58,11 @@ def on_touch_up(self, touch):
class GUILayout(MDFloatLayout, MDGridLayout):
image_path = StringProperty(os.path.join(os.path.dirname(__file__), 'music.png'))
if platform != "android":
set_local_download = os.path.join(os.path.expanduser('~/Documents'), 'Youtube Music Player', 'Downloaded',
'Played')
set_local_download = os.path.normpath(os.path.join(os.path.expanduser('~/Documents'), 'Youtube Music Player', 'Downloaded',
'Played'))
else:
set_local_download = f'{os.getcwd()}//Downloaded//Played'
os.makedirs(set_local_download, exist_ok=True)
os.makedirs(set_local_download)

def __draw_shadow__(self, origin, end, context=None):
pass
Expand Down

0 comments on commit 36e49b3

Please sign in to comment.