linter fixes
This commit is contained in:
parent
ce04722763
commit
83db5730f2
@ -94,7 +94,9 @@ class DataUtils:
|
|||||||
|
|
||||||
|
|
||||||
def scrub_lyrics(self, lyrics: str) -> str:
|
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'(\[.*?\])(\s){0,}(\:){0,1}', '', lyrics)
|
||||||
lyrics = regex.sub(r'(\d?)(Embed\b)', '', lyrics, flags=regex.IGNORECASE)
|
lyrics = regex.sub(r'(\d?)(Embed\b)', '', lyrics, flags=regex.IGNORECASE)
|
||||||
lyrics = regex.sub(r'\n{2}', '\n', lyrics) # Gaps between verses
|
lyrics = regex.sub(r'\n{2}', '\n', lyrics) # Gaps between verses
|
||||||
@ -102,6 +104,9 @@ class DataUtils:
|
|||||||
return lyrics
|
return lyrics
|
||||||
|
|
||||||
def create_lrc_object(self, lrc_str: str) -> list[dict]:
|
def create_lrc_object(self, lrc_str: str) -> list[dict]:
|
||||||
|
"""Create LRC Object
|
||||||
|
@lrc_str: The raw LRCLib syncedLyrics (str)
|
||||||
|
"""
|
||||||
lrc_out: list = []
|
lrc_out: list = []
|
||||||
for line in lrc_str.split("\n"):
|
for line in lrc_str.split("\n"):
|
||||||
_timetag = None
|
_timetag = None
|
||||||
@ -126,4 +131,3 @@ class DataUtils:
|
|||||||
logging.info("util: returning %s, type: %s",
|
logging.info("util: returning %s, type: %s",
|
||||||
lrc_out, type(lrc_out))
|
lrc_out, type(lrc_out))
|
||||||
return lrc_out
|
return lrc_out
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user