Misc fixes/optimizations

This commit is contained in:
Nathan Thomas 2021-08-13 16:19:04 -07:00
parent 246d69cb30
commit 6cfd068a97
5 changed files with 12 additions and 11 deletions

View file

@ -44,6 +44,7 @@ class DownloadCommand(Command):
def handle(self):
global outdated
global newest_version
# Use a thread so that it doesn't slow down startup
update_check = threading.Thread(target=is_outdated, daemon=True)
@ -102,7 +103,7 @@ class DownloadCommand(Command):
)
md_header = re.compile(r"#\s+(.+)")
bullet_point = re.compile(r"-\s*(.+)")
bullet_point = re.compile(r"-\s+(.+)")
code = re.compile(r"`([^`]+)`")
issue_reference = re.compile(r"(#\d+)")

View file

@ -459,7 +459,7 @@ class RipCore(list):
for item, url in zip(soundcloud_items, soundcloud_urls)
)
logger.debug(f"Parsed urls: {parsed}")
logger.debug("Parsed urls: %s", parsed)
return parsed
@ -501,7 +501,7 @@ class RipCore(list):
# This will match somthing like "Test (Person Remix]" though, so its not perfect
banned_words_plain = re.compile(r"(?i)(?:(?:re)?mix|live|karaoke)")
banned_words = re.compile(
rf"(?i)[\(\[][^\)\]]*?(?:(?:re)?mix|live|karaoke)[^\)\]]*[\]\)]"
r"(?i)[\(\[][^\)\]]*?(?:(?:re)?mix|live|karaoke)[^\)\]]*[\]\)]"
)
def search_query(title, artist, playlist) -> bool:

View file

@ -45,7 +45,7 @@ class Database:
)
command = f"CREATE TABLE {self.name} ({params})"
logger.debug(f"executing {command}")
logger.debug("executing %s", command)
conn.execute(command)