@@ -137,6 +137,7 @@ function App() {
137137 const [ editingTrack , setEditingTrack ] = useState < Track | null > ( null ) ;
138138 const [ advancedEditMode , setAdvancedEditMode ] = useState ( false ) ;
139139 const [ uuidParam , setUuidParam ] = useState < string | null > ( null ) ;
140+ const [ revisionParam , setRevisionParam ] = useState < string | null > ( null ) ;
140141 const [ selectedFile , setSelectedFile ] = useState < File | null > ( null ) ;
141142 const [ loadError , setLoadError ] = useState < string | null > ( null ) ;
142143 const [ serviceParam , setServiceParam ] = useState < string > ( 'dubbing' ) ;
@@ -163,6 +164,7 @@ function App() {
163164 useEffect ( ( ) => {
164165 const params = new URLSearchParams ( window . location . search ) ;
165166 const uuidParam = params . get ( 'uuid' ) ;
167+ const revisionParam = params . get ( 'revision' ) ;
166168 const serviceParam = params . get ( 'service' ) as 'dubbing' | 'transcription' | null ;
167169 if ( serviceParam ) {
168170 setAppMode ( serviceParam ) ;
@@ -172,9 +174,13 @@ function App() {
172174
173175 console . log ( "Initial useEffect - UUID param:" , uuidParam , "Service param:" , serviceParam , "App mode:" , appMode ) ;
174176
177+ if ( revisionParam ) {
178+ setRevisionParam ( revisionParam ) ;
179+ }
180+
175181 if ( uuidParam ) {
176182 setUuidParam ( uuidParam ) ;
177- handleFileOrUUIDSelect ( null , uuidParam ) ;
183+ handleFileOrUUIDSelect ( null , uuidParam , revisionParam ) ;
178184 } else {
179185 setLoadError ( 'errorLoadingUUID' ) ;
180186 }
@@ -241,7 +247,7 @@ function App() {
241247 i18n . changeLanguage ( event . target . value ) ;
242248 } ;
243249
244- const handleFileOrUUIDSelect = useCallback ( async ( file : File | null , newUuid : string | null ) => {
250+ const handleFileOrUUIDSelect = useCallback ( async ( file : File | null , newUuid : string | null , revision : string | null ) => {
245251 console . log ( "handleFileOrUUIDSelect called with UUID:" , newUuid ) ;
246252
247253 // Revoke existing object URL if there is one
@@ -264,15 +270,15 @@ function App() {
264270 await DubbingAPIService . uuidExists ( newUuid ) ;
265271
266272 // Set initial video URL
267- setMediaUrl ( DubbingAPIService . getMediaUrl ( newUuid ) ) ;
273+ setMediaUrl ( DubbingAPIService . getMediaUrl ( newUuid , revision ?? '' ) ) ;
268274 setMediaType ( 'video/mp4' ) ;
269275 } else if ( serviceParam === "transcription" ) {
270276 const [ videoDataResponse , tracksDataResponse ] = await Promise . all ( [
271277 TranscriptionAPIService . getMediaMetadata ( newUuid ) ,
272278 TranscriptionAPIService . loadTracksFromUUID ( newUuid )
273279 ] ) ;
274280
275- setMediaUrl ( TranscriptionAPIService . getMediaUrl ( newUuid ) ) ;
281+ setMediaUrl ( TranscriptionAPIService . getMediaUrl ( newUuid , revision ?? '' ) ) ;
276282 setMediaType ( videoDataResponse . contentType ) ;
277283 setMediaFileName ( videoDataResponse . filename ) ;
278284 setTracks ( TranscriptionAPIService . parseTracksFromJSON ( tracksDataResponse ) ) ;
@@ -389,7 +395,7 @@ function App() {
389395
390396 const handleSubmit = ( ) => {
391397 if ( selectedFile ) {
392- handleFileOrUUIDSelect ( selectedFile , null ) ;
398+ handleFileOrUUIDSelect ( selectedFile , null , null ) ;
393399 }
394400 } ;
395401
@@ -546,8 +552,9 @@ function App() {
546552 const handleSimpleDownload = ( ) => {
547553 const params = new URLSearchParams ( window . location . search ) ;
548554 const uuid = params . get ( 'uuid' ) ;
555+ const revision = params . get ( 'revision' ) ?? '' ;
549556 if ( uuid ) {
550- const url = DubbingAPIService . getMediaUrl ( uuid ) ;
557+ const url = DubbingAPIService . getMediaUrl ( uuid , revision ) ;
551558 const a = document . createElement ( 'a' ) ;
552559 a . href = url ;
553560 a . download = `dubbed_video.mp4` ;
0 commit comments