Skip to content

Commit 2e6ae89

Browse files
authored
Merge pull request #339 from aaronvegh/av/bsky-video-size-update
Update Max Video Size
2 parents 263f093 + ea96ef3 commit 2e6ae89

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

Sources/ATProtoKit/APIReference/ATProtoBlueskyAPI/PostRecord/CreatePostRecord.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ extension ATProtoBluesky {
725725
) async throws -> AppBskyLexicon.Feed.PostRecord.EmbedUnion {
726726
// Check if the size of the video is small enough.
727727
if video.count >= AttachmentLexiconLimit.videoEmbed {
728-
throw ATJobStatusError.videoSizeTooLarge(message: "The video file is too large. The maximum file size is currently 100MB.")
728+
throw ATJobStatusError.videoSizeTooLarge(message: "The video file is too large. The maximum file size is currently 300MB.")
729729
}
730730

731731

Sources/ATProtoKit/Models/Lexicons/app.bsky/Video/AppBskyVideoDefs.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,41 @@ extension AppBskyLexicon.Video {
6666
/// The job is currently encoding.
6767
case jobStateEncoding = "JOB_STATE_ENCODING"
6868

69+
/// The job is encoded.
70+
case jobStateEncoded = "JOB_STATE_ENCODED"
71+
6972
/// The job is currently scanning.
7073
case jobStateScanning = "JOB_STATE_SCANNING"
7174

7275
/// The job is scanned.
7376
case jobStateScanned = "JOB_STATE_SCANNED"
7477

78+
/// The job is currently uploading.
79+
case jobStateUploading = "JOB_STATE_UPLOADING"
80+
81+
/// The job is uploaded.
82+
case jobStateUploaded = "JOB_STATE_UPLOADED"
83+
7584
/// The job is completed processing.
7685
case jobStateCompleted = "JOB_STATE_COMPLETED"
7786

7887
/// The job failed to complete the processing.
7988
case jobStateFailed = "JOB_STATE_FAILED"
89+
90+
/// A state this version of the lexicon does not name.
91+
///
92+
/// `app.bsky.video.defs` declares `state` as an open set: "All values
93+
/// not listed as a known value indicate that the job is in process."
94+
/// Decoding an unrecognised value as an error fails the whole upload
95+
/// the moment the service reports a state added after this type was
96+
/// written, so anything unknown lands here and callers treat it the
97+
/// same as any other in-progress state.
98+
case jobStateInProcess = "JOB_STATE_IN_PROCESS"
99+
100+
public init(from decoder: any Decoder) throws {
101+
let rawValue = try decoder.singleValueContainer().decode(String.self)
102+
self = State(rawValue: rawValue) ?? .jobStateInProcess
103+
}
80104
}
81105
}
82106
}

Sources/ATProtoKit/Utilities/AttachmentLexiconLimit.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ public enum AttachmentLexiconLimit {
6969
/// [list]: https://github.com/bluesky-social/atproto/blob/main/lexicons/app/bsky/graph/list.json
7070
public static let listAvatar = 1_000_000
7171

72-
/// The maximum size of a video embed: 100,000,000 bytes.
72+
/// The maximum size of a video embed: 300,000,000 bytes.
7373
///
7474
/// Declared by `app.bsky.embed.video` at `defs.main.properties.video.maxSize`.
7575
///
7676
/// - SeeAlso: [`app.bsky.embed.video`][video] lexicon.
7777
///
7878
/// [video]: https://github.com/bluesky-social/atproto/blob/main/lexicons/app/bsky/embed/video.json
79-
public static let videoEmbed = 100_000_000
79+
public static let videoEmbed = 300_000_000
8080

8181
/// The maximum size of a video VTT caption file: 20,000 bytes.
8282
///

0 commit comments

Comments
 (0)