@@ -41,7 +41,7 @@ class Api extends HttpApi.make("CapWebApi").add(
4141 . addError ( HttpApiError . InternalServerError )
4242 . addError ( HttpApiError . NotFound ) ,
4343 ) ,
44- ) { }
44+ ) { }
4545
4646const ApiLive = HttpApiBuilder . api ( Api ) . pipe (
4747 Layer . provide (
@@ -76,6 +76,7 @@ const ApiLive = HttpApiBuilder.api(Api).pipe(
7676 PolicyDenied : ( ) => new HttpApiError . Unauthorized ( ) ,
7777 DatabaseError : ( ) => new HttpApiError . InternalServerError ( ) ,
7878 S3Error : ( ) => new HttpApiError . InternalServerError ( ) ,
79+ UnknownException : ( ) => new HttpApiError . InternalServerError ( ) ,
7980 } ) ,
8081 ) ,
8182 ) ;
@@ -128,6 +129,8 @@ const getPlaylistResponse = (
128129 ) ;
129130 }
130131
132+ yield * Effect . log ( "Resolving path with custom bucket" ) ;
133+
131134 const videoPrefix = `${ video . ownerId } /${ video . id } /video/` ;
132135 const audioPrefix = `${ video . ownerId } /${ video . id } /audio/` ;
133136
@@ -155,6 +158,9 @@ const getPlaylistResponse = (
155158 headers : CACHE_CONTROL_HEADERS ,
156159 } ) ;
157160 } else if ( video . source . type === "desktopMP4" ) {
161+ yield * Effect . log (
162+ `Returning path ${ `${ video . ownerId } /${ video . id } /result.mp4` } ` ,
163+ ) ;
158164 return yield * s3
159165 . getSignedObjectUrl ( `${ video . ownerId } /${ video . id } /result.mp4` )
160166 . pipe ( Effect . map ( HttpServerResponse . redirect ) ) ;
@@ -192,13 +198,11 @@ const getPlaylistResponse = (
192198 const generatedPlaylist = generateMasterPlaylist (
193199 videoMetadata ?. Metadata ?. resolution ?? "" ,
194200 videoMetadata ?. Metadata ?. bandwidth ?? "" ,
195- `${ serverEnv ( ) . WEB_URL } /api/playlist?userId=${
196- video . ownerId
201+ `${ serverEnv ( ) . WEB_URL } /api/playlist?userId=${ video . ownerId
197202 } &videoId=${ video . id } &videoType=video`,
198203 audioMetadata
199- ? `${ serverEnv ( ) . WEB_URL } /api/playlist?userId=${
200- video . ownerId
201- } &videoId=${ video . id } &videoType=audio`
204+ ? `${ serverEnv ( ) . WEB_URL } /api/playlist?userId=${ video . ownerId
205+ } &videoId=${ video . id } &videoType=audio`
202206 : null ,
203207 ) ;
204208
0 commit comments