.0
This commit is contained in:
parent
7841c3f640
commit
bc333b4258
2
base.py
2
base.py
@ -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)
|
xc_endpoints = importlib.import_module("endpoints.xc").XC(app, util, constants, glob_state)
|
||||||
# Below: Karma endpoint(s)
|
# Below: Karma endpoint(s)
|
||||||
karma_endpoints = importlib.import_module("endpoints.karma").Karma(app, util, constants, glob_state)
|
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
|
# Below: Misc endpoints
|
||||||
misc_endpoints = importlib.import_module("endpoints.misc").Misc(app, util, constants, glob_state)
|
misc_endpoints = importlib.import_module("endpoints.misc").Misc(app, util, constants, glob_state)
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import json
|
|||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
import regex
|
import regex
|
||||||
|
import asyncio
|
||||||
sys.path.insert(1,'..')
|
sys.path.insert(1,'..')
|
||||||
from lyric_search import notifier
|
from lyric_search import notifier
|
||||||
from lyric_search.constructors import LyricsResult
|
from lyric_search.constructors import LyricsResult
|
||||||
@ -44,6 +45,10 @@ class RedisCache:
|
|||||||
regex.compile(r'\-'),
|
regex.compile(r'\-'),
|
||||||
regex.compile(r'[^a-zA-Z0-9\s]'),
|
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:
|
async def create_index(self) -> None:
|
||||||
"""Create Index"""
|
"""Create Index"""
|
||||||
@ -59,7 +64,8 @@ class RedisCache:
|
|||||||
if str(result) != "OK":
|
if str(result) != "OK":
|
||||||
raise RedisException(f"Redis: Failed to create index: {result}")
|
raise RedisException(f"Redis: Failed to create index: {result}")
|
||||||
except Exception as e:
|
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]:
|
def sanitize_input(self, artist: str, song: str, fuzzy: bool = False) -> tuple[str, str]:
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user