This commit is contained in:
codey 2025-01-30 19:33:04 -05:00
parent 7841c3f640
commit bc333b4258
2 changed files with 9 additions and 1 deletions

View File

@ -95,6 +95,8 @@ yt_endpoints = importlib.import_module("endpoints.yt").YT(app, util, constants,
xc_endpoints = importlib.import_module("endpoints.xc").XC(app, util, constants, glob_state)
# Below: Karma endpoint(s)
karma_endpoints = importlib.import_module("endpoints.karma").Karma(app, util, constants, glob_state)
# Below: Radio endpoint(s) - in development, sporadically loaded as needed
# radio_endpoints = importlib.import_module("endpoints.radio").Radio(app, util, constants, glob_state)
# Below: Misc endpoints
misc_endpoints = importlib.import_module("endpoints.misc").Misc(app, util, constants, glob_state)

View File

@ -9,6 +9,7 @@ import json
import time
import sys
import regex
import asyncio
sys.path.insert(1,'..')
from lyric_search import notifier
from lyric_search.constructors import LyricsResult
@ -44,6 +45,10 @@ class RedisCache:
regex.compile(r'\-'),
regex.compile(r'[^a-zA-Z0-9\s]'),
]
try:
asyncio.get_event_loop().create_task(self.create_index())
except:
pass
async def create_index(self) -> None:
"""Create Index"""
@ -59,7 +64,8 @@ class RedisCache:
if str(result) != "OK":
raise RedisException(f"Redis: Failed to create index: {result}")
except Exception as e:
await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"Failed to create idx: {str(e)}")
pass
# await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"Failed to create idx: {str(e)}")
def sanitize_input(self, artist: str, song: str, fuzzy: bool = False) -> tuple[str, str]:
"""