mirror of
https://github.com/nathom/streamrip.git
synced 2025-06-06 01:31:19 -04:00
Fix SoundCloud search #122
This commit is contained in:
parent
65aa1efc38
commit
5ab0fdbc4a
4 changed files with 23 additions and 10 deletions
|
@ -314,9 +314,9 @@ class MusicDL(list):
|
|||
continue
|
||||
|
||||
if hasattr(item, "id"):
|
||||
self.db.add(item.id)
|
||||
self.db.add(str(item.id))
|
||||
for item_id in item.downloaded_ids:
|
||||
self.db.add(item_id)
|
||||
self.db.add(str(item_id))
|
||||
|
||||
if isinstance(item, Track):
|
||||
item.tag()
|
||||
|
|
|
@ -68,7 +68,7 @@ class Database:
|
|||
conditions = " AND ".join(f"{key}=?" for key in items.keys())
|
||||
command = f"SELECT EXISTS(SELECT 1 FROM {self.name} WHERE {conditions})"
|
||||
|
||||
logger.debug(f"executing {command}")
|
||||
logger.debug("Executing %s", command)
|
||||
|
||||
return bool(conn.execute(command, tuple(items.values())).fetchone()[0])
|
||||
|
||||
|
@ -108,7 +108,8 @@ class Database:
|
|||
question_marks = ", ".join("?" for _ in items)
|
||||
command = f"INSERT INTO {self.name} ({params}) VALUES ({question_marks})"
|
||||
|
||||
logger.debug(f"executing {command}")
|
||||
logger.debug("Executing %s", command)
|
||||
logger.debug("Items to add: %s", items)
|
||||
|
||||
with sqlite3.connect(self.path) as conn:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue