Fixed local playlists for Linux

glob module gave different results on Linux.
Most likely fixed
This commit is contained in:
Twentysix 2016-01-10 08:27:45 +01:00
parent 2e78a3f829
commit 761bd7eb2c

8
red.py
View File

@ -935,10 +935,10 @@ async def playLocal(message):
if localplaylists and ("/" not in msg[1] and "\\" not in msg[1]):
if msg[1] in localplaylists:
files = []
if glob.glob("localtracks\\" + msg[1] + "\\*.mp3"):
files.extend(glob.glob("localtracks\\" + msg[1] + "\\*.mp3"))
if glob.glob("localtracks\\" + msg[1] + "\\*.flac"):
files.extend(glob.glob("localtracks\\" + msg[1] + "\\*.flac"))
if glob.glob("localtracks/" + msg[1] + "/*.mp3"):
files.extend(glob.glob("localtracks/" + msg[1] + "/*.mp3"))
if glob.glob("localtracks/" + msg[1] + "/*.flac"):
files.extend(glob.glob("localtracks/" + msg[1] + "/*.flac"))
stopMusic()
data = {"filename" : files, "type" : "local"}
currentPlaylist = Playlist(data)