diff --git a/src/dataimport/pietsmietdevideoimporter.py b/src/dataimport/pietsmietdevideoimporter.py index 98c92a7..76ffd8a 100644 --- a/src/dataimport/pietsmietdevideoimporter.py +++ b/src/dataimport/pietsmietdevideoimporter.py @@ -3,6 +3,8 @@ import json import asyncio from uuid import uuid4 +from PIL import Image +from io import BytesIO from rich.console import Console from databases import Database @@ -128,15 +130,32 @@ async def stuff() -> asyncio.coroutine: f"Try redownloading thumbnail for {content['remoteId']}...", style="bright_magenta", ) + + filename_id = uuid4() try: thumbnail = requests.get(content["imageUri"]).content - filename = f"{uuid4()}.jpg" - with open(f"/app/cdn/psde/{filename}", "wb") as f: + with open(f"/app/cdn/psde/{filename_id}.jpg", "wb") as f: f.write(thumbnail) - newImageUri = f"/cdn/psde/{filename}" + newImageUri = f"/cdn/psde/{filename_id}.jpg" except Exception as e: console.log(f"Error downloading thumbnail: {e}", style="bold red") + try: + console.log( + f"Resizing thumbnail for {content['remoteId']}...", + style="bright_magenta", + ) + image = Image.open(BytesIO(thumbnail)) + width, height = 300, int((300 / image.width) * image.height) + resized_300 = image.resize((width, height)) + resized_300.save(f"/app/cdn/psde/{filename_id}-w300.jpg") + + width, height = 768, int((768 / image.width) * image.height) + resized_768 = image.resize((width, height)) + resized_768.save(f"/app/cdn/psde/{filename_id}-w768.jpg") + except Exception as e: + console.log(f"Error resizing thumbnail: {e}", style="bold red") + await db.execute( UPDATE_STATEMENT, values={ @@ -156,16 +175,36 @@ async def stuff() -> asyncio.coroutine: ) if content["imageUri"] != None: + filename_id = uuid4() try: + console.log( + f"Downloading thumbnail for {content['remoteId']}...", + style="bright_magenta", + ) thumbnail = requests.get(content["imageUri"]).content - filename = f"{uuid4()}.jpg" - with open(f"/app/cdn/psde/{filename}", "wb") as f: + with open(f"/app/cdn/psde/{filename_id}.jpg", "wb") as f: f.write(thumbnail) - content["imageUri"] = f"/cdn/psde/{filename}" + content["imageUri"] = f"/cdn/psde/{filename_id}.jpg" except Exception as e: console.log(f"Error downloading thumbnail: {e}", style="bold red") content["imageUri"] = content["imageUri"] + try: + console.log( + f"Resizing thumbnail for {content['remoteId']}...", + style="bright_magenta", + ) + image = Image.open(BytesIO(thumbnail)) + width, height = 300, int((300 / image.width) * image.height) + resized_300 = image.resize((width, height)) + resized_300.save(f"/app/cdn/psde/{filename_id}-w300.jpg") + + width, height = 768, int((768 / image.width) * image.height) + resized_768 = image.resize((width, height)) + resized_768.save(f"/app/cdn/psde/{filename_id}-w768.jpg") + except Exception as e: + console.log(f"Error resizing thumbnail: {e}", style="bold red") + await db.execute( INSERT_STATEMENT, values={ diff --git a/src/dataimport/youtube_video_linker.py b/src/dataimport/youtube_video_linker.py index 34b3aeb..a296f5a 100644 --- a/src/dataimport/youtube_video_linker.py +++ b/src/dataimport/youtube_video_linker.py @@ -25,7 +25,8 @@ collection_url = "https://www.googleapis.com/youtube/v3/search?part=snippet&order=date&maxResults=50&channelId={}&type=video&key={}" youtube_url_template = "https://youtu.be/{}" -UPDATE_STATEMENT = "UPDATE ContentPiece SET description = :description, secondaryHref = :secondaryHref WHERE id = :id" +UPDATE_STATEMENT_CONTENTPIECE = "UPDATE ContentPiece SET description = :description, secondaryHref = :secondaryHref WHERE id = :id AND type = 'PSVideo'" +UPDATE_STATEMENT_PLAN = "UPDATE ScheduledContentPiece SET description = :description, secondaryHref = :secondaryHref WHERE remoteId = :remoteId AND type = 'PSVideo'" def replace_emojis_with_question_mark(text): @@ -74,27 +75,44 @@ async def youtube(): "upperBoundary": one_week_after.strftime("%Y-%m-%d %H:%M:%S"), } + description = video["snippet"]["description"] + secondaryHref = youtube_url_template.format(video["id"]["videoId"]) + result = await db.fetch_one(query=query, values=values) if not result: console.log(f"Could not find a matching video for '{title}'") continue - if result.description is not None or result.secondaryHref is not None: - console.log( - f"ContentPiece {result.id} already has a description or secondaryHref" - ) - continue - description = video["snippet"]["description"] - secondaryHref = youtube_url_template.format(video["id"]["videoId"]) + if result.description is None and result.secondaryHref is None: + values = { + "id": result.id, + "description": description, + "secondaryHref": secondaryHref, + } - values = { - "id": result.id, - "description": description, - "secondaryHref": secondaryHref, - } + console.log( + f"Updating ContentPiece {result.id} with secondaryHref {secondaryHref}" + ) + await db.execute(query=UPDATE_STATEMENT_CONTENTPIECE, values=values) + else: + console.log( + f"ContentPiece {result.id} already has a description and secondaryHref. Skipping update" + ) - console.log(f"Updating {result.id} with secondaryHref {secondaryHref}") - await db.execute(query=UPDATE_STATEMENT, values=values) + if result.remoteId: + values = { + "remoteId": result.remoteId, + "description": description, + "secondaryHref": secondaryHref, + } + console.log( + f"Updating ScheduledContentPiece {result.remoteId} with secondaryHref {secondaryHref}" + ) + await db.execute(query=UPDATE_STATEMENT_PLAN, values=values) + else: + console.log( + f"ContentPiece {result.id} does not have a remoteId. Skipping ScheduledContentPiece update" + ) await db.disconnect() console.log("Done") diff --git a/src/psaggregator/package-lock.json b/src/psaggregator/package-lock.json index 53564c4..45e782c 100644 --- a/src/psaggregator/package-lock.json +++ b/src/psaggregator/package-lock.json @@ -1,12 +1,12 @@ { "name": "psaggregator", - "version": "1.19.1", + "version": "1.19.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "psaggregator", - "version": "1.19.1", + "version": "1.19.2", "dependencies": { "@internationalized/date": "^3.5.5", "@sentry/sveltekit": "^8.41.0", @@ -1015,9 +1015,9 @@ } }, "node_modules/@opentelemetry/context-async-hooks": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.28.0.tgz", - "integrity": "sha512-igcl4Ve+F1N2063PJUkesk/GkYyuGIWinYkSyAFTnIj3gzrOgvOA4k747XNdL47HRRL1w/qh7UW8NDuxOLvKFA==", + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.29.0.tgz", + "integrity": "sha512-TKT91jcFXgHyIDF1lgJF3BHGIakn6x0Xp7Tq3zoS3TMPzT9IlP0xEavWP8C1zGjU9UmZP2VR1tJhW9Az1A3w8Q==", "engines": { "node": ">=14" }, @@ -1026,11 +1026,11 @@ } }, "node_modules/@opentelemetry/core": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.28.0.tgz", - "integrity": "sha512-ZLwRMV+fNDpVmF2WYUdBHlq0eOWtEaUJSusrzjGnBt7iSRvfjFE3RXYUZJrqou/wIDWV0DwQ5KIfYe9WXg9Xqw==", + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.29.0.tgz", + "integrity": "sha512-gmT7vAreXl0DTHD2rVZcw3+l2g84+5XiHIqdBUxXbExymPCvSsGOpiwMmn8nkiJur28STV31wnhIDrzWDPzjfA==", "dependencies": { - "@opentelemetry/semantic-conventions": "1.27.0" + "@opentelemetry/semantic-conventions": "1.28.0" }, "engines": { "node": ">=14" @@ -1039,14 +1039,6 @@ "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, - "node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", - "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "engines": { - "node": ">=14" - } - }, "node_modules/@opentelemetry/instrumentation": { "version": "0.54.2", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.54.2.tgz", @@ -1891,12 +1883,12 @@ } }, "node_modules/@opentelemetry/resources": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.28.0.tgz", - "integrity": "sha512-cIyXSVJjGeTICENN40YSvLDAq4Y2502hGK3iN7tfdynQLKWb3XWZQEkPc+eSx47kiy11YeFAlYkEfXwR1w8kfw==", + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.29.0.tgz", + "integrity": "sha512-s7mLXuHZE7RQr1wwweGcaRp3Q4UJJ0wazeGlc/N5/XSe6UyXfsh1UQGMADYeg7YwD+cEdMtU1yJAUXdnFzYzyQ==", "dependencies": { - "@opentelemetry/core": "1.28.0", - "@opentelemetry/semantic-conventions": "1.27.0" + "@opentelemetry/core": "1.29.0", + "@opentelemetry/semantic-conventions": "1.28.0" }, "engines": { "node": ">=14" @@ -1905,22 +1897,14 @@ "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, - "node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", - "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "engines": { - "node": ">=14" - } - }, "node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.28.0.tgz", - "integrity": "sha512-ceUVWuCpIao7Y5xE02Xs3nQi0tOGmMea17ecBdwtCvdo9ekmO+ijc9RFDgfifMl7XCBf41zne/1POM3LqSTZDA==", + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.29.0.tgz", + "integrity": "sha512-hEOpAYLKXF3wGJpXOtWsxEtqBgde0SCv+w+jvr3/UusR4ll3QrENEGnSl1WDCyRrpqOQ5NCNOvZch9UFVa7MnQ==", "dependencies": { - "@opentelemetry/core": "1.28.0", - "@opentelemetry/resources": "1.28.0", - "@opentelemetry/semantic-conventions": "1.27.0" + "@opentelemetry/core": "1.29.0", + "@opentelemetry/resources": "1.29.0", + "@opentelemetry/semantic-conventions": "1.28.0" }, "engines": { "node": ">=14" @@ -1929,14 +1913,6 @@ "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, - "node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", - "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "engines": { - "node": ">=14" - } - }, "node_modules/@opentelemetry/semantic-conventions": { "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", @@ -2384,50 +2360,46 @@ ] }, "node_modules/@sentry-internal/browser-utils": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.41.0.tgz", - "integrity": "sha512-nU7Bn3jEUmf1QXRUT3j2ewUBlFJpe9vnAnjqpeVPDWTsVI52BwVNcJHuE37PrGs66OZ1ZkGMfKnQk43oCAa+oQ==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.42.0.tgz", + "integrity": "sha512-xzgRI0wglKYsPrna574w1t38aftuvo44gjOKFvPNGPnYfiW9y4m+64kUz3JFbtanvOrKPcaITpdYiB4DeJXEbA==", "dependencies": { - "@sentry/core": "8.41.0", - "@sentry/types": "8.41.0" + "@sentry/core": "8.42.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/feedback": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.41.0.tgz", - "integrity": "sha512-bw+BrSNw8abOnu/IpD8YSbYubXkkT8jyNS7TM4e4UPZMuXcbtia7/r5d7kAiUfKv/sV5PNMlZLOk+EYJeLTANg==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.42.0.tgz", + "integrity": "sha512-dkIw5Wdukwzngg5gNJ0QcK48LyJaMAnBspqTqZ3ItR01STi6Z+6+/Bt5XgmrvDgRD+FNBinflc5zMmfdFXXhvw==", "dependencies": { - "@sentry/core": "8.41.0", - "@sentry/types": "8.41.0" + "@sentry/core": "8.42.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.41.0.tgz", - "integrity": "sha512-ByXEY7JI95y4Qr9fS3d28l9uuVU5Qa0HgL+xDmYElNx7CXz3Q9hFN6ibgUeC3h8BO5pDULxWNgAppl7FRY8N5w==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.42.0.tgz", + "integrity": "sha512-oNcJEBlDfXnRFYC5Mxj5fairyZHNqlnU4g8kPuztB9G5zlsyLgWfPxzcn1ixVQunth2/WZRklDi4o1ZfyHww7w==", "dependencies": { - "@sentry-internal/browser-utils": "8.41.0", - "@sentry/core": "8.41.0", - "@sentry/types": "8.41.0" + "@sentry-internal/browser-utils": "8.42.0", + "@sentry/core": "8.42.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay-canvas": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.41.0.tgz", - "integrity": "sha512-lpgOBHWr1ZNxidD72A2pfoUMjIpwonOPYoQZWAHr86Oa3eIVQOyfklZlHW+gKPFl2/IEl9Lbtcke0JiDp3dkIQ==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.42.0.tgz", + "integrity": "sha512-XrPErqVhPsPh/oFLVKvz7Wb+Fi2J1zCPLeZCxWqFuPWI2agRyLVu0KvqJyzSpSrRAEJC/XFzuSVILlYlXXSfgA==", "dependencies": { - "@sentry-internal/replay": "8.41.0", - "@sentry/core": "8.41.0", - "@sentry/types": "8.41.0" + "@sentry-internal/replay": "8.42.0", + "@sentry/core": "8.42.0" }, "engines": { "node": ">=14.18" @@ -2442,16 +2414,15 @@ } }, "node_modules/@sentry/browser": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.41.0.tgz", - "integrity": "sha512-FfAU55eYwW2lG4M3dEw2472RvHrD5YWSfHCZvuRf/4skX38kFvKghZQ+epL+CVHTzvIRHOrbj8qQK6YLTGl9ew==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.42.0.tgz", + "integrity": "sha512-lStrEk609KJHwXfDrOgoYVVoFFExixHywxSExk7ZDtwj2YPv6r6Y1gogvgr7dAZj7jWzadHkxZ33l9EOSJBfug==", "dependencies": { - "@sentry-internal/browser-utils": "8.41.0", - "@sentry-internal/feedback": "8.41.0", - "@sentry-internal/replay": "8.41.0", - "@sentry-internal/replay-canvas": "8.41.0", - "@sentry/core": "8.41.0", - "@sentry/types": "8.41.0" + "@sentry-internal/browser-utils": "8.42.0", + "@sentry-internal/feedback": "8.42.0", + "@sentry-internal/replay": "8.42.0", + "@sentry-internal/replay-canvas": "8.42.0", + "@sentry/core": "8.42.0" }, "engines": { "node": ">=14.18" @@ -2662,20 +2633,17 @@ } }, "node_modules/@sentry/core": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.41.0.tgz", - "integrity": "sha512-3v7u3t4LozCA5SpZY4yqUN2U3jSrkXNoLgz6L2SUUiydyCuSwXZIFEwpLJfgQyidpNDifeQbBI5E1O910XkPsA==", - "dependencies": { - "@sentry/types": "8.41.0" - }, + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.42.0.tgz", + "integrity": "sha512-ac6O3pgoIbU6rpwz6LlwW0wp3/GAHuSI0C5IsTgIY6baN8rOBnlAtG6KrHDDkGmUQ2srxkDJu9n1O6Td3cBCqw==", "engines": { "node": ">=14.18" } }, "node_modules/@sentry/node": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.41.0.tgz", - "integrity": "sha512-eYD5S8Lti9efBHFSIhZ/0C5uI1DQtGqjuNWQ62CKC47G2qgJddBtb2HgqRFAnMajYL9FXEtiDT6uqQhKQnmLcQ==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.42.0.tgz", + "integrity": "sha512-MsNrmAIwDaxf1jTX1FsgZ+3mUq6G6IuU6FAqyp7TDnvUTsbWUtr0OM6EvVUz0zCImybIh9dcTQ+6KTmUyA7URw==", "dependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/context-async-hooks": "^1.25.1", @@ -2709,9 +2677,8 @@ "@opentelemetry/sdk-trace-base": "^1.26.0", "@opentelemetry/semantic-conventions": "^1.27.0", "@prisma/instrumentation": "5.19.1", - "@sentry/core": "8.41.0", - "@sentry/opentelemetry": "8.41.0", - "@sentry/types": "8.41.0", + "@sentry/core": "8.42.0", + "@sentry/opentelemetry": "8.42.0", "import-in-the-middle": "^1.11.2" }, "engines": { @@ -2719,12 +2686,11 @@ } }, "node_modules/@sentry/opentelemetry": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.41.0.tgz", - "integrity": "sha512-Ld6KdBQsmSk2IfFSoZ7CMpmuQbfb3viV6nTDCz6+11wL9S+1b+hadCN+38yBW4CmI4/hEpYfwwWQPseQQTvBCg==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.42.0.tgz", + "integrity": "sha512-QPb9kMFgl35TIwIz0u+BFTbPG461CofMiloidJ44GFZ9cB33T5cB0oIN7ut/5tsH/AvqUmucydsV/Nj3HNQx9g==", "dependencies": { - "@sentry/core": "8.41.0", - "@sentry/types": "8.41.0" + "@sentry/core": "8.42.0" }, "engines": { "node": ">=14.18" @@ -2738,13 +2704,12 @@ } }, "node_modules/@sentry/svelte": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry/svelte/-/svelte-8.41.0.tgz", - "integrity": "sha512-sX21afj2dJuFwSwDWvkrbihGEMhiwOYKypvZqpd7Rqxqj3RKho8rsjNqvDR18yd3XBTSZKkKcLjxH+TeQOwPRQ==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry/svelte/-/svelte-8.42.0.tgz", + "integrity": "sha512-rL+1iIoHbNE+uSr/Yzve/UQHw4QPm2dgPv/kcXPHlSa0HGzPsc1EkURAYnDW/N/d0GV+tLTq44LVVoyFCpzvhA==", "dependencies": { - "@sentry/browser": "8.41.0", - "@sentry/core": "8.41.0", - "@sentry/types": "8.41.0", + "@sentry/browser": "8.42.0", + "@sentry/core": "8.42.0", "magic-string": "^0.30.0" }, "engines": { @@ -2755,15 +2720,14 @@ } }, "node_modules/@sentry/sveltekit": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry/sveltekit/-/sveltekit-8.41.0.tgz", - "integrity": "sha512-6hjY4qdCm/UrhUafoNo5VLRoiHoIpxl3sm/alb0yr5A1fsUA+o3p3zJHhxKgWE34i7/tnRmmTMg22wLwD5heGA==", - "dependencies": { - "@sentry/core": "8.41.0", - "@sentry/node": "8.41.0", - "@sentry/opentelemetry": "8.41.0", - "@sentry/svelte": "8.41.0", - "@sentry/types": "8.41.0", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@sentry/sveltekit/-/sveltekit-8.42.0.tgz", + "integrity": "sha512-0xbhLa9DkjDtvMWBV20GOqGZaRfXBwEnx2VuDKpyp4+MXPsb7wFu+LLxa9/VUsyT3TL9UUZmPIeNL54TuYXEwA==", + "dependencies": { + "@sentry/core": "8.42.0", + "@sentry/node": "8.42.0", + "@sentry/opentelemetry": "8.42.0", + "@sentry/svelte": "8.42.0", "@sentry/vite-plugin": "2.22.6", "magic-string": "0.30.7", "magicast": "0.2.8", @@ -2795,14 +2759,6 @@ "sorcery": "bin/sorcery" } }, - "node_modules/@sentry/types": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.41.0.tgz", - "integrity": "sha512-eqdnGr9k9H++b9CjVUoTNUVahPVWeNnMy0YGkqS5+cjWWC+x43p56202oidGFmWo6702ub/xwUNH6M5PC4kq6A==", - "engines": { - "node": ">=14.18" - } - }, "node_modules/@sentry/vite-plugin": { "version": "2.22.6", "resolved": "https://registry.npmjs.org/@sentry/vite-plugin/-/vite-plugin-2.22.6.tgz", @@ -4430,9 +4386,9 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -4453,7 +4409,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -4468,6 +4424,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/express/node_modules/cookie": { @@ -5054,9 +5014,9 @@ } }, "node_modules/import-in-the-middle": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.2.tgz", - "integrity": "sha512-gK6Rr6EykBcc6cVWRSBR5TWf8nn6hZMYSRYqCcHa0l0d1fPK7JSYo6+Mlmck76jIX9aL/IZ71c06U2VpFwl1zA==", + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.3.tgz", + "integrity": "sha512-tNpKEb4AjZrCyrxi+Eyu43h5ig0O8ZRFSXPHh/00/o+4P4pKzVEW/m5lsVtsAT7fCIgmQOAPjdqecGDsBXRxsw==", "dependencies": { "acorn": "^8.8.2", "acorn-import-attributes": "^1.9.5", @@ -5921,9 +5881,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "node_modules/path-type": { "version": "4.0.0", diff --git a/src/psaggregator/package.json b/src/psaggregator/package.json index d3955f0..c85b719 100644 --- a/src/psaggregator/package.json +++ b/src/psaggregator/package.json @@ -1,6 +1,6 @@ { "name": "psaggregator", - "version": "1.19.1", + "version": "1.19.2", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/src/psaggregator/src/lib/components/PSVideo.svelte b/src/psaggregator/src/lib/components/PSVideo.svelte index 7138fbc..bac3487 100644 --- a/src/psaggregator/src/lib/components/PSVideo.svelte +++ b/src/psaggregator/src/lib/components/PSVideo.svelte @@ -12,7 +12,8 @@ let classes = ""; export { classes as class }; - $: humanReadableMinutes = video.duration ? Math.floor(video.duration / 60) : null; + $: humanReadableHours = video.duration ? Math.floor(video.duration / 3600) : null; + $: humanReadableMinutes = video.duration ? Math.floor((video.duration % 3600) / 60) : null; $: humanReadableSeconds = video.duration ? video.duration % 60 : null; @@ -54,7 +55,9 @@
{#if humanReadableMinutes !== null && humanReadableSeconds !== null} {("00" + humanReadableMinutes).slice(-2)}:{("00" + humanReadableSeconds).slice(-2)} + >{#if humanReadableHours}{("00" + humanReadableHours).slice(-2)}:{/if}{("00" + humanReadableMinutes).slice(-2)}:{( + "00" + humanReadableSeconds + ).slice(-2)} {/if} diff --git a/src/psaggregator/src/lib/components/UploadPlanEntry.svelte b/src/psaggregator/src/lib/components/UploadPlanEntry.svelte index 0917783..914e637 100644 --- a/src/psaggregator/src/lib/components/UploadPlanEntry.svelte +++ b/src/psaggregator/src/lib/components/UploadPlanEntry.svelte @@ -5,6 +5,7 @@ import Sparkle from "./Sparkle.svelte"; import * as Card from "$lib/components/ui/card"; import { Button } from "./ui/button"; + import { LINK_YOUTUBE } from "../../config/config"; export let entry: ScheduledContentPiece; @@ -34,7 +35,7 @@ {/if} {#if entry.href} -