diff --git a/lyric_search/sources/cache.py b/lyric_search/sources/cache.py index 226acbf..8a29696 100644 --- a/lyric_search/sources/cache.py +++ b/lyric_search/sources/cache.py @@ -113,7 +113,7 @@ class Cache: logging.error("ERROR @ %s: %s", __file__.rsplit("/", maxsplit=1)[-1], f"cache::store >> {str(e)}") 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, params: Optional[tuple] = None) -> int: diff --git a/lyric_search/sources/genius.py b/lyric_search/sources/genius.py index 667b18f..bfed68f 100644 --- a/lyric_search/sources/genius.py +++ b/lyric_search/sources/genius.py @@ -103,7 +103,7 @@ class Genius: html = BeautifulSoup(htm.unescape(scrape_text).replace('
', '\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: for tag in header_tags_genius: tag.extract() diff --git a/lyric_search/sources/redis_cache.py b/lyric_search/sources/redis_cache.py index e498b35..655323e 100644 --- a/lyric_search/sources/redis_cache.py +++ b/lyric_search/sources/redis_cache.py @@ -175,7 +175,7 @@ class RedisCache: search_res_out = [(out_id, search_res)] 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 except Exception as e: traceback.print_exc() @@ -218,9 +218,9 @@ class RedisCache: logging.info("Stored %s - %s (related SQLite Row ID: %s) to %s", lyr_result.artist, lyr_result.song, sqlite_id, newkey) 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: file: str = __file__.rsplit("/", maxsplit=1)[-1] await self.notifier.send(f"ERROR @ {file}", - f"Failed to store {lyr_result.artist} - {lyr_result.song}\ - (SQLite id: {sqlite_id}) to Redis:\n{str(e)}") \ No newline at end of file + f"Failed to store `{lyr_result.artist} - {lyr_result.song}`\ + (SQLite id: `{sqlite_id}`) to Redis:\n`{str(e)}`") \ No newline at end of file diff --git a/utils/radio_util.py b/utils/radio_util.py index bbe7d4f..029b3fc 100644 --- a/utils/radio_util.py +++ b/utils/radio_util.py @@ -187,14 +187,14 @@ class RadioUtil: """ # 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... """ 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, timeout=2) as db_conn: