This commit is contained in:
codey 2025-04-10 19:38:43 -04:00
parent ca883b2974
commit 4506714d0a
4 changed files with 8 additions and 8 deletions

View File

@ -113,7 +113,7 @@ class Cache:
logging.error("ERROR @ %s: %s", logging.error("ERROR @ %s: %s",
__file__.rsplit("/", maxsplit=1)[-1], f"cache::store >> {str(e)}") __file__.rsplit("/", maxsplit=1)[-1], f"cache::store >> {str(e)}")
await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}",
f"cache::store >> {str(e)}") f"cache::store >> `{str(e)}`")
async def sqlite_rowcount(self, where: Optional[str] = None, async def sqlite_rowcount(self, where: Optional[str] = None,
params: Optional[tuple] = None) -> int: params: Optional[tuple] = None) -> int:

View File

@ -103,7 +103,7 @@ class Genius:
html = BeautifulSoup(htm.unescape(scrape_text).replace('<br/>', '\n'), "html.parser") html = BeautifulSoup(htm.unescape(scrape_text).replace('<br/>', '\n'), "html.parser")
header_tags_genius: Optional[ResultSet] = html.find_all(class_=re.compile('.*Header.*')) header_tags_genius: Optional[ResultSet] = html.find_all(class_=re.compile(r'.*Header.*'))
if header_tags_genius: if header_tags_genius:
for tag in header_tags_genius: for tag in header_tags_genius:
tag.extract() tag.extract()

View File

@ -175,7 +175,7 @@ class RedisCache:
search_res_out = [(out_id, search_res)] search_res_out = [(out_id, search_res)]
if not search_res_out and self.notify_warnings: if not search_res_out and self.notify_warnings:
await self.notifier.send("WARNING", f"Redis cache miss for: \n## *{artist} - {song}*") await self.notifier.send("WARNING", f"Redis cache miss for: `{artist} - {song}`")
return search_res_out return search_res_out
except Exception as e: except Exception as e:
traceback.print_exc() traceback.print_exc()
@ -218,9 +218,9 @@ class RedisCache:
logging.info("Stored %s - %s (related SQLite Row ID: %s) to %s", logging.info("Stored %s - %s (related SQLite Row ID: %s) to %s",
lyr_result.artist, lyr_result.song, sqlite_id, newkey) lyr_result.artist, lyr_result.song, sqlite_id, newkey)
await self.notifier.send("INFO", await self.notifier.send("INFO",
f"Stored {lyr_result.artist} - {lyr_result.song} (related SQLite Row ID: {sqlite_id}) to redis: {newkey}") f"Stored `{lyr_result.artist} - {lyr_result.song}` (related SQLite Row ID: `{sqlite_id}`) to redis: `{newkey}`")
except Exception as e: except Exception as e:
file: str = __file__.rsplit("/", maxsplit=1)[-1] file: str = __file__.rsplit("/", maxsplit=1)[-1]
await self.notifier.send(f"ERROR @ {file}", await self.notifier.send(f"ERROR @ {file}",
f"Failed to store {lyr_result.artist} - {lyr_result.song}\ f"Failed to store `{lyr_result.artist} - {lyr_result.song}`\
(SQLite id: {sqlite_id}) to Redis:\n{str(e)}") (SQLite id: `{sqlite_id}`) to Redis:\n`{str(e)}`")

View File

@ -187,14 +187,14 @@ class RadioUtil:
""" """
# db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ # db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
# WHERE genre LIKE "%edm%" OR artist LIKE "%sullivan king%" OR artist LIKE "%kai wachi%" OR artist LIKE "%kayzo%" ORDER BY RANDOM()' #ORDER BY artist DESC, album ASC, song ASC' # WHERE (artist LIKE "%bad omens%") AND (NOT song LIKE "%(live%") ORDER BY artist DESC, album ASC, song ASC'
""" """
LIMITED TO ONE/SOME ARTISTS... LIMITED TO ONE/SOME ARTISTS...
""" """
db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
WHERE (artist LIKE "%chunk! no, %" OR artist LIKE "woe,%" OR artist LIKE "%woe is%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%(2022)%" AND NOT song LIKE "%(live%%" AND NOT song LIKE "%%acoustic%%" AND NOT song LIKE "%%instrumental%%" AND NOT song LIKE "%%remix%%" AND NOT song LIKE "%%reimagined%%" AND NOT song LIKE "%%alternative%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY RANDOM()'# ORDER BY album ASC, id ASC' WHERE (artist LIKE "%we butter%" OR artist LIKE "%eisbrecher%" OR artist LIKE "%black ang%" OR artist LIKE "%madison affair%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%(2022)%" AND NOT song LIKE "%(live%%" AND NOT song LIKE "%%acoustic%%" AND NOT song LIKE "%%instrumental%%" AND NOT song LIKE "%%remix%%" AND NOT song LIKE "%%reimagined%%" AND NOT song LIKE "%%alternative%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY RANDOM()'# ORDER BY album ASC, id ASC'
async with sqlite3.connect(self.active_playlist_path, async with sqlite3.connect(self.active_playlist_path,
timeout=2) as db_conn: timeout=2) as db_conn: