linter fixes
This commit is contained in:
@@ -73,9 +73,9 @@ class LRCLib:
|
||||
possible_matches = [(x, f"{result.get('artistName')} - {result.get('trackName')}")
|
||||
for x, result in enumerate(search_data)]
|
||||
else:
|
||||
logging.info("Limiting possible matches to only those with non-null syncedLyrics")
|
||||
possible_matches = [(x, f"{result.get('artistName')} - {result.get('trackName')}")
|
||||
for x, result in enumerate(search_data) if isinstance(result['syncedLyrics'], str)]
|
||||
logging.info("Limiting possible matches to only those with non-null syncedLyrics")
|
||||
possible_matches = [(x, f"{result.get('artistName')} - {result.get('trackName')}")
|
||||
for x, result in enumerate(search_data) if isinstance(result['syncedLyrics'], str)]
|
||||
|
||||
|
||||
|
||||
|
@@ -94,7 +94,9 @@ class DataUtils:
|
||||
|
||||
|
||||
def scrub_lyrics(self, lyrics: str) -> str:
|
||||
"""Regex Chain"""
|
||||
"""Regex Chain
|
||||
@lyrics: The lyrics (str) to scrub
|
||||
"""
|
||||
lyrics = regex.sub(r'(\[.*?\])(\s){0,}(\:){0,1}', '', lyrics)
|
||||
lyrics = regex.sub(r'(\d?)(Embed\b)', '', lyrics, flags=regex.IGNORECASE)
|
||||
lyrics = regex.sub(r'\n{2}', '\n', lyrics) # Gaps between verses
|
||||
@@ -102,6 +104,9 @@ class DataUtils:
|
||||
return lyrics
|
||||
|
||||
def create_lrc_object(self, lrc_str: str) -> list[dict]:
|
||||
"""Create LRC Object
|
||||
@lrc_str: The raw LRCLib syncedLyrics (str)
|
||||
"""
|
||||
lrc_out: list = []
|
||||
for line in lrc_str.split("\n"):
|
||||
_timetag = None
|
||||
@@ -125,5 +130,4 @@ class DataUtils:
|
||||
})
|
||||
logging.info("util: returning %s, type: %s",
|
||||
lrc_out, type(lrc_out))
|
||||
return lrc_out
|
||||
|
||||
return lrc_out
|
Reference in New Issue
Block a user