- Implemented a new script to upsert data from SQLite dumps into PostgreSQL asynchronously.
- Added detailed reporting for each table processed, including success and error statuses. - Integrated Discord notifications for various stages of the upsert process. - Included functionality to fetch the latest SQLite dump from a specified URL. - Added error handling and state management for the upsert process. Resolves #34
This commit is contained in:
@@ -127,7 +127,9 @@ class MemeUtil:
|
||||
db_conn.row_factory = sqlite3.Row
|
||||
rows_per_page: int = 10
|
||||
offset: int = (page - 1) * rows_per_page
|
||||
query: str = "SELECT id, timestamp FROM memes ORDER BY timestamp DESC LIMIT 10 OFFSET ?"
|
||||
query: str = (
|
||||
"SELECT id, timestamp FROM memes ORDER BY timestamp DESC LIMIT 10 OFFSET ?"
|
||||
)
|
||||
async with await db_conn.execute(query, (offset,)) as db_cursor:
|
||||
results = await db_cursor.fetchall()
|
||||
for result in results:
|
||||
|
||||
@@ -1269,9 +1269,11 @@ class SRUtil:
|
||||
album,
|
||||
song,
|
||||
selected_artist,
|
||||
best_track.get("album", {}).get("title")
|
||||
if best_track.get("album")
|
||||
else None,
|
||||
(
|
||||
best_track.get("album", {}).get("title")
|
||||
if best_track.get("album")
|
||||
else None
|
||||
),
|
||||
selected_title,
|
||||
):
|
||||
# Try to find another candidate that does match metadata
|
||||
@@ -1294,9 +1296,11 @@ class SRUtil:
|
||||
album,
|
||||
song,
|
||||
cand_artist,
|
||||
candidate.get("album", {}).get("title")
|
||||
if candidate.get("album")
|
||||
else None,
|
||||
(
|
||||
candidate.get("album", {}).get("title")
|
||||
if candidate.get("album")
|
||||
else None
|
||||
),
|
||||
cand_title,
|
||||
):
|
||||
found_better = candidate
|
||||
|
||||
Reference in New Issue
Block a user