video merge

This commit is contained in:
Peter Maquiran
2024-02-07 16:45:53 +01:00
parent 4c56fa819c
commit 60edd1ca01
11 changed files with 586 additions and 421 deletions
@@ -1,8 +1,10 @@
import { Injectable } from '@angular/core';
import { MiddlewareServiceService } from "src/app/shared/API/middleware/middleware-service.service";
import { CMAPIAPIService } from "src/app/shared/API/CMAPI/cmapi-api.service";
import { ok, err } from 'neverthrow';
import { ok, err, Result } from 'neverthrow';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { IuploadFileLK } from '../../API/middleware/interface';
@Injectable({
providedIn: 'root'
@@ -15,16 +17,38 @@ export class CMAPIService {
window["CMAPIAPIRepository"] = this
}
async FileContent({length, path, index, blobFile}) {
async FileContent({length, path, index, blobFile}): Promise<Result<IuploadFileLK, "badRequest" | "other">> {
try {
const result = await this.MiddlewareServiceService.CMAPIFileContent({length, path, index, blobFile}).toPromise();
return ok(result)
} catch (error) {
if(error.status >= 400 && error.status >= 499) {
return err("badRequest")
}
return err("other")
}
}
async RequestUpload(): Promise<Result<string, any>> {
try {
const result = await this.MiddlewareServiceService.CMAPIRequestUpload().toPromise();
return ok(result)
} catch (error) {
return err(error)
}
}
async UploadStatus() {
try {
const result = await this.MiddlewareServiceService.CMAPIUploadStatus().toPromise();
return ok(result)
} catch (error) {
return err(error)
}
}
async ping() {