From 875931954ecadda3baeb6ec1fb96eacdea690d5b Mon Sep 17 00:00:00 2001 From: zaanposni Date: Mon, 22 Jan 2024 21:50:44 +0100 Subject: [PATCH 1/4] ignore streams if existing timeframe exists --- src/dataimport/pietsmietdeuploadplan.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/dataimport/pietsmietdeuploadplan.py b/src/dataimport/pietsmietdeuploadplan.py index 8126520..fc7b304 100644 --- a/src/dataimport/pietsmietdeuploadplan.py +++ b/src/dataimport/pietsmietdeuploadplan.py @@ -221,6 +221,18 @@ async def stuff() -> asyncio.coroutine: await db.execute(query) console.log(f"Updated entry for {content.title} on {content.time}.") elif content.type == "TwitchStream" or not existing_imports_for_today: + if content.type == "TwitchStream": + query = "SELECT * FROM ScheduledContentPiece WHERE startDate = '{}' AND type = 'TwitchStream'".format( + content.time.strftime("%Y-%m-%d %H:%M:%S") + ) + result = await db.fetch_all(query) + if len(result) > 0: + console.log( + f"Found existing entry for stream {content.title} on {content.time}. Skipping...", + style="bold yellow", + ) + continue + console.log( f"Adding {content.title} on {content.time} to database...", style="bold yellow", From 40386b2f4e99bc134d96ea786275c6f275c8e6d4 Mon Sep 17 00:00:00 2001 From: zaanposni Date: Mon, 22 Jan 2024 21:50:55 +0100 Subject: [PATCH 2/4] fix timezone --- src/dataimport/informationopenaianalyze.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dataimport/informationopenaianalyze.py b/src/dataimport/informationopenaianalyze.py index 81bd61e..4b4de39 100644 --- a/src/dataimport/informationopenaianalyze.py +++ b/src/dataimport/informationopenaianalyze.py @@ -116,7 +116,7 @@ async def openai(): continue start_date = parse(stream["start"]) - start_date = start_date.replace(tzinfo=timezone.utc) + start_date = start_date.astimezone(timezone.utc) if start_date.year < datetime.now().year: start_date = start_date.replace(year=datetime.now().year) From 594b2579fe1fd8aa79d8265bad9542c70d3b545f Mon Sep 17 00:00:00 2001 From: zaanposni Date: Mon, 22 Jan 2024 21:51:15 +0100 Subject: [PATCH 3/4] bump version --- src/psaggregator/package-lock.json | 4 ++-- src/psaggregator/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/psaggregator/package-lock.json b/src/psaggregator/package-lock.json index 856f3c2..91082c5 100644 --- a/src/psaggregator/package-lock.json +++ b/src/psaggregator/package-lock.json @@ -1,12 +1,12 @@ { "name": "psaggregator", - "version": "1.2.1", + "version": "1.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "psaggregator", - "version": "1.2.1", + "version": "1.2.2", "devDependencies": { "@fontsource/fira-mono": "^4.5.10", "@neoconfetti/svelte": "^1.0.0", diff --git a/src/psaggregator/package.json b/src/psaggregator/package.json index 1d6ab3a..30c05b0 100644 --- a/src/psaggregator/package.json +++ b/src/psaggregator/package.json @@ -1,6 +1,6 @@ { "name": "psaggregator", - "version": "1.2.1", + "version": "1.2.2", "scripts": { "dev": "vite dev", "build": "vite build", From ff0bc8fcc9ab44c8566bce7a08cd3c573ee08bad Mon Sep 17 00:00:00 2001 From: zaanposni Date: Mon, 22 Jan 2024 21:58:12 +0100 Subject: [PATCH 4/4] . --- src/psaggregator/src/lib/components/UploadPlanEntry.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/psaggregator/src/lib/components/UploadPlanEntry.svelte b/src/psaggregator/src/lib/components/UploadPlanEntry.svelte index ef0763a..93e7e5d 100644 --- a/src/psaggregator/src/lib/components/UploadPlanEntry.svelte +++ b/src/psaggregator/src/lib/components/UploadPlanEntry.svelte @@ -28,7 +28,7 @@ {entry.title} {#if entry.importedFrom === "OpenAI"}
-
+
{/if} @@ -54,7 +54,7 @@ {entry.title} {#if entry.importedFrom === "OpenAI"}
-
+
{/if}