mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
Merge branch 'develop' into cog-changes
This commit is contained in:
commit
e0edfedde3
@ -451,14 +451,6 @@ class Audio:
|
|||||||
|
|
||||||
return song
|
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):
|
def _is_queue_playlist(self, server):
|
||||||
if server.id not in self.queue:
|
if server.id not in self.queue:
|
||||||
return False
|
return False
|
||||||
@ -481,6 +473,14 @@ class Audio:
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
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):
|
def _list_playlists(self, server):
|
||||||
try:
|
try:
|
||||||
server = server.id
|
server = server.id
|
||||||
@ -490,18 +490,13 @@ class Audio:
|
|||||||
old_playlists = [f[:-4] for f in os.listdir(path)
|
old_playlists = [f[:-4] for f in os.listdir(path)
|
||||||
if f.endswith(".txt")]
|
if f.endswith(".txt")]
|
||||||
path = os.path.join(path, server)
|
path = os.path.join(path, server)
|
||||||
new_playlists = [f[:-4] for f in os.listdir(path)
|
if os.path.exists(path):
|
||||||
if f.endswith(".txt")]
|
new_playlists = [f[:-4] for f in os.listdir(path)
|
||||||
|
if f.endswith(".txt")]
|
||||||
|
else:
|
||||||
|
new_playlists = []
|
||||||
return list(set(old_playlists + 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):
|
def _load_playlist(self, server, name, local=True):
|
||||||
try:
|
try:
|
||||||
server = server.id
|
server = server.id
|
||||||
|
|||||||
@ -5,6 +5,7 @@ from .utils import checks
|
|||||||
from __main__ import send_cmd_help, settings
|
from __main__ import send_cmd_help, settings
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
import asyncio
|
||||||
|
|
||||||
|
|
||||||
class Mod:
|
class Mod:
|
||||||
|
|||||||
1
red.py
1
red.py
@ -245,6 +245,7 @@ def set_logger():
|
|||||||
|
|
||||||
stdout_handler = logging.StreamHandler(sys.stdout)
|
stdout_handler = logging.StreamHandler(sys.stdout)
|
||||||
stdout_handler.setFormatter(red_format)
|
stdout_handler.setFormatter(red_format)
|
||||||
|
stdout_handler.setLevel(logging.INFO)
|
||||||
|
|
||||||
fhandler = logging.handlers.RotatingFileHandler(
|
fhandler = logging.handlers.RotatingFileHandler(
|
||||||
filename='data/red/red.log', encoding='utf-8', mode='a',
|
filename='data/red/red.log', encoding='utf-8', mode='a',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user