From a750b52832f6f708eb1faf387138a234b59b871a Mon Sep 17 00:00:00 2001 From: Joris Bertomeu Date: Tue, 26 Aug 2025 20:10:45 +0200 Subject: [PATCH] Fix dl issue --- src/app/app.component.ts | 4 ++-- src/app/video-processing.service.ts | 4 ++-- src/environments/environment.ts | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 46b7e9c..03d98a8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -173,9 +173,9 @@ export class AppComponent implements OnInit { downloadFileFromAPI(filePath: string, filename: string, job: any) { job.isDownloading = true; - this.videoProcessingService.downloadFile(filePath).subscribe({ + this.videoProcessingService.downloadFile(`${job.data.mp4Filename}/${filename}`).subscribe({ next: (response) => { - const blob = new Blob([response], { type: 'video/mp4' }); + const blob = new Blob([response], { type: 'video/mkv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; diff --git a/src/app/video-processing.service.ts b/src/app/video-processing.service.ts index 016f9b8..9b6f389 100644 --- a/src/app/video-processing.service.ts +++ b/src/app/video-processing.service.ts @@ -31,8 +31,8 @@ export class VideoProcessingService { return this.http.post(`${this.apiUrl}/processUpdate`, data); } - downloadFile(filePath: string): Observable { - return this.http.get(`${this.apiUrl}/download${filePath}`, { responseType: 'blob' }); + downloadFile(filename: string): Observable { + return this.http.get(`${this.apiUrl}/download?filename=${encodeURIComponent(filename)}`, { responseType: 'blob' }); } flushQueue(): Observable { diff --git a/src/environments/environment.ts b/src/environments/environment.ts index a5546e9..3a08a88 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,3 +1,4 @@ export const environment = { serviceEndpoint: '/api' + //serviceEndpoint: 'http://192.168.1.230:6080/api' };