diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ed385cd..3b1a5ba 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,7 @@
-
-
-
-
-
+
@@ -84,7 +80,7 @@
-
+
@@ -254,7 +250,15 @@
1704790607299
-
+
+
+ 1704792896546
+
+
+
+ 1704792896546
+
+
@@ -283,6 +287,7 @@
-
+
+
\ No newline at end of file
diff --git a/src/cogs/ytdl.py b/src/cogs/ytdl.py
index bd20097..dface41 100644
--- a/src/cogs/ytdl.py
+++ b/src/cogs/ytdl.py
@@ -79,7 +79,7 @@ class YTDLCog(commands.Cog):
"""
)
await db.commit()
- return aiosqlite.connect("./data/ytdl.db")
+ return
async def save_link(self, message: discord.Message, webpage_url: str, format_id: str, attachment_index: int = 0):
"""
@@ -90,7 +90,8 @@ class YTDLCog(commands.Cog):
:param attachment_index: The index of the attachment. Defaults to 0
:return: The created hash key
"""
- async with self._init_db() as db:
+ await self._init_db()
+ async with aiosqlite.connect("./data/ytdl.db") as db:
_hash = hashlib.md5(f"{webpage_url}:{format_id}".encode())
await db.execute(
"""
@@ -109,7 +110,8 @@ class YTDLCog(commands.Cog):
:param format_id: The format ID
:return: the URL, if found and valid.
"""
- async with self._init_db() as db:
+ await self._init_db()
+ async with aiosqlite.connect("./data/ytdl.db") as db:
_hash = hashlib.md5(f"{webpage_url}:{format_id}".encode())
cursor = await db.execute(
"SELECT (message_id, channel_id, attachment_index) FROM downloads WHERE key=?",