Skip to content

Commit 85c736d

Browse files
committed
make Video.metadata optional
1 parent 35dedfa commit 85c736d

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

apps/web/app/api/playlist/route.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,12 @@ const ApiLive = HttpApiBuilder.api(Api).pipe(
7070
).pipe(Effect.provide(S3ProviderLayer));
7171
}).pipe(
7272
provideOptionalAuth,
73+
Effect.tapErrorCause(Effect.logError),
7374
Effect.catchTags({
7475
VerifyVideoPasswordError: () => new HttpApiError.Forbidden(),
7576
PolicyDenied: () => new HttpApiError.Unauthorized(),
76-
DatabaseError: (e) =>
77-
Effect.logError(e).pipe(
78-
Effect.andThen(() => new HttpApiError.InternalServerError()),
79-
),
80-
S3Error: (e) =>
81-
Effect.logError(e).pipe(
82-
Effect.andThen(() => new HttpApiError.InternalServerError()),
83-
),
77+
DatabaseError: () => new HttpApiError.InternalServerError(),
78+
S3Error: () => new HttpApiError.InternalServerError(),
8479
}),
8580
),
8681
);

packages/web-domain/src/Video.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export class Video extends Schema.Class<Video>("Video")({
1515
ownerId: Schema.String,
1616
name: Schema.String,
1717
public: Schema.Boolean,
18-
metadata: Schema.Record({ key: Schema.String, value: Schema.Any }),
18+
metadata: Schema.OptionFromNullOr(
19+
Schema.Record({ key: Schema.String, value: Schema.Any }),
20+
),
1921
source: Schema.Struct({
2022
type: Schema.Literal("MediaConvert", "local", "desktopMP4"),
2123
}),

0 commit comments

Comments
 (0)