Fixing logging issues in music_functions.py and other_functions.py

This commit is contained in:
2025-01-31 19:30:48 +01:00
parent 993b303e2f
commit 323a1ac021
2 changed files with 16 additions and 11 deletions
+6 -4
View File
@@ -20,7 +20,6 @@ from constants import (
from spotify_dl import spotify
from spotify_dl import youtube as youtube_download
logger = logging.getLogger("discord")
class MusicFileList(object):
@@ -29,10 +28,11 @@ class MusicFileList(object):
file service or local directory and update the list with new items.
"""
def __init__(self, uplogger,) -> None:
def __init__(self, logger_name) -> None:
self.music_file_list = []
self.file_service_active = False
self.logger = uplogger
self.logger = logging.getLogger("discord")
self.logger.info("Created Playlist organizer class")
async def refresh_file_list(self, bot):
@@ -100,7 +100,7 @@ class MusicFileList(object):
requests.post(f"{FILE_SERVICE_ADDRESS}{SEND_MP3}", json=post_data, timeout=360)
MUSIC_FILE_LIST = MusicFileList(logger)
MUSIC_FILE_LIST = MusicFileList("discord")
async def get_file(ctx, source, link):
@@ -118,6 +118,7 @@ async def get_file(ctx, source, link):
:param link: The "link" parameter is likely a string that represents a URL or file path to the
location of the file that the function is trying to retrieve
"""
logger = logging.getLogger("discord")
item_id = None
item_type = None
file_list = []
@@ -288,6 +289,7 @@ async def search_music(ctx, how_many=0, slowa_kluczowe=None):
how_many, the function will return all search results, defaults to 0 (optional)
"""
# i sieć neuronową z możliwością wyrażenia opinii o dopasowaniu.
logger = logging.getLogger("discord")
if slowa_kluczowe:
word_list = slowa_kluczowe
else: