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) 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", 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", 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"}
-