about summary refs log tree commit diff
path: root/src/lib
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-09-07 19:27:32 +0100
committerGitHub <noreply@github.com>2024-09-07 19:27:32 +0100
commit45a719b256173f98b20457cc80b4288e84f1c33f (patch)
treec377172ddaae5469ba6fb54457687f590339ed8e /src/lib
parentb7d78fe59b73294ac13baa51a6a7cd94698cb205 (diff)
downloadvoidsky-45a719b256173f98b20457cc80b4288e84f1c33f.tar.zst
[Video] Check upload limits before uploading (#5153)
* DRY up video service auth code

* throw error if over upload limits

* use token

* xmark on toast

* errors with nice translatable error messages

* Update src/state/queries/video/video.ts

---------

Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/constants.ts3
-rw-r--r--src/lib/media/video/errors.ts7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 5be099d0e..9bf1fb35e 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -137,6 +137,9 @@ export const GIF_FEATURED = (params: string) =>
 
 export const MAX_LABELERS = 20
 
+export const VIDEO_SERVICE = 'https://video.bsky.app'
+export const VIDEO_SERVICE_DID = 'did:web:video.bsky.app'
+
 export const SUPPORTED_MIME_TYPES = [
   'video/mp4',
   'video/mpeg',
diff --git a/src/lib/media/video/errors.ts b/src/lib/media/video/errors.ts
index a06a239e1..1c55a9ee9 100644
--- a/src/lib/media/video/errors.ts
+++ b/src/lib/media/video/errors.ts
@@ -11,3 +11,10 @@ export class ServerError extends Error {
     this.name = 'ServerError'
   }
 }
+
+export class UploadLimitError extends Error {
+  constructor(message: string) {
+    super(message)
+    this.name = 'UploadLimitError'
+  }
+}