diff --git a/cogs/audio.py b/cogs/audio.py index 93d8cd212..0dd66a69f 100644 --- a/cogs/audio.py +++ b/cogs/audio.py @@ -451,14 +451,6 @@ class Audio: return song - def _list_local_playlists(self): - ret = [] - for thing in os.listdir(self.local_playlist_path): - if os.path.isdir(os.path.join(self.local_playlist_path, thing)): - ret.append(thing) - log.debug("local playlists:\n\t{}".format(ret)) - return ret - def _is_queue_playlist(self, server): if server.id not in self.queue: return False @@ -481,6 +473,14 @@ class Audio: except AttributeError: pass + def _list_local_playlists(self): + ret = [] + for thing in os.listdir(self.local_playlist_path): + if os.path.isdir(os.path.join(self.local_playlist_path, thing)): + ret.append(thing) + log.debug("local playlists:\n\t{}".format(ret)) + return ret + def _list_playlists(self, server): try: server = server.id @@ -490,18 +490,13 @@ class Audio: old_playlists = [f[:-4] for f in os.listdir(path) if f.endswith(".txt")] path = os.path.join(path, server) - new_playlists = [f[:-4] for f in os.listdir(path) - if f.endswith(".txt")] + if os.path.exists(path): + new_playlists = [f[:-4] for f in os.listdir(path) + if f.endswith(".txt")] + else: + new_playlists = [] return list(set(old_playlists + new_playlists)) - def _list_local_playlists(self): - ret = [] - for thing in os.listdir(self.local_playlist_path): - if os.path.isdir(os.path.join(self.local_playlist_path, thing)): - ret.append(thing) - log.debug("local playlists:\n\t{}".format(ret)) - return ret - def _load_playlist(self, server, name, local=True): try: server = server.id diff --git a/cogs/mod.py b/cogs/mod.py index 1d29c7117..20d66daef 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -5,6 +5,7 @@ from .utils import checks from __main__ import send_cmd_help, settings import os import logging +import asyncio class Mod: diff --git a/red.py b/red.py index 6dc95d504..958968744 100644 --- a/red.py +++ b/red.py @@ -245,6 +245,7 @@ def set_logger(): stdout_handler = logging.StreamHandler(sys.stdout) stdout_handler.setFormatter(red_format) + stdout_handler.setLevel(logging.INFO) fhandler = logging.handlers.RotatingFileHandler( filename='data/red/red.log', encoding='utf-8', mode='a',