diff --git a/front/package.json b/front/package.json index b6cbff5..a72723e 100644 --- a/front/package.json +++ b/front/package.json @@ -31,7 +31,7 @@ "rxjs": "^7.8.1", "zone.js": "^0.14.4", "zod": "3.22.4", - "@kangaroo-and-rabbit/kar-cw": "^0.1.5" + "@kangaroo-and-rabbit/kar-cw": "^0.1.7" }, "devDependencies": { "@angular-devkit/build-angular": "^17.3.1", diff --git a/front/src/app/component/element-player-audio/element-player-audio.ts b/front/src/app/component/element-player-audio/element-player-audio.ts index add96f0..62f7a1c 100644 --- a/front/src/app/component/element-player-audio/element-player-audio.ts +++ b/front/src/app/component/element-player-audio/element-player-audio.ts @@ -40,7 +40,7 @@ export class ElementPlayerAudioComponent implements OnInit { public name: string = 'rr'; public description: string; - public counttrack: number; + public countTrack: number; public covers: string[]; @@ -108,7 +108,6 @@ export class ElementPlayerAudioComponent implements OnInit { console.log(`get response of video : ${JSON.stringify(response, null, 2)}`); self.currentLMedia = response; self.dataTitle = response.name; - console.log("aaa"); if (!isNullOrUndefined(response.albumId)) { this.albumService.get(response.albumId) .then((response2: Album) => { @@ -117,22 +116,21 @@ export class ElementPlayerAudioComponent implements OnInit { }) .catch(() => { }); } - console.log("aaa"); if (!isNullOrUndefined(response.artists) && isArray(response.artists) && response.artists.length > 0) { this.artistService.get(response.artists[0]) .then((response2: Artist) => { self.dataAuthor = response2.name; }) .catch(() => { }); - } console.log("aaa"); + } if (isNullOrUndefined(self.currentLMedia)) { console.log("Can not retrieve the media ...") return; - } console.log("aaa"); + } if (isNullOrUndefined(self.currentLMedia.dataId)) { console.log("Can not retrieve the media ... null or undefined data ID") return; - } console.log("aaa"); + } self.mediaSource = self.dataService.getUrl(self.currentLMedia.dataId, "unknownMediaName.webm"); }).catch((error) => { console.error(`error not unmanaged in audio player ... 111 ${error}`); diff --git a/front/src/app/service/data.ts b/front/src/app/service/data.ts index 598b941..9d6fef1 100644 --- a/front/src/app/service/data.ts +++ b/front/src/app/service/data.ts @@ -40,8 +40,11 @@ export class DataService { params: { dataId } - });//.replace("http://localhost:19080", "https://atria-soft.org"); + }); console.log(`get URL = ${url}`); + if (environment?.replaceDataToRealServer === true) { + return url.replace("http://localhost:19080", "https://atria-soft.org"); + } return url; } const url = RESTUrl({ @@ -54,8 +57,10 @@ export class DataService { dataId, optionalName } - });//.replace("http://localhost:19080", "https://atria-soft.org"); - console.log(`get URL = ${url}`); + }); + if (environment?.replaceDataToRealServer === true) { + return url.replace("http://localhost:19080", "https://atria-soft.org"); + } return url; } /** @@ -79,7 +84,7 @@ export class DataService { * @returns the url of the cover */ getThumbnailUrl(coverId: string): string { - return RESTUrl({ + const url = RESTUrl({ restModel: { endPoint: "data/thumbnail/{coverId}", tokenInUrl: true, @@ -88,7 +93,11 @@ export class DataService { params: { coverId } - });//.replace("http://localhost:19080", "https://atria-soft.org"); + }); + if (environment?.replaceDataToRealServer === true) { + return url.replace("http://localhost:19080", "https://atria-soft.org"); + } + return url; } /** * Retrieve the list thumbnail cover URL of a specific data id diff --git a/front/src/app/service/track.ts b/front/src/app/service/track.ts index 82ba984..1bc6853 100644 --- a/front/src/app/service/track.ts +++ b/front/src/app/service/track.ts @@ -31,22 +31,7 @@ export class TrackService extends GenericDataService { const self = this; this.setStore(new DataStore(() => this.lambdaGets())); } - /* - insert(data: Track): Promise { - const self = this; - return new Promise((resolve, reject) => { - TrackResource.post({ - restConfig: this.getRestConfig(), - data - }).then((value: Track) => { - self.dataStore.updateValue(value); - resolve(value); - }).catch((error) => { - reject(error); - }); - }); - } - */ + patch(id: number, data: Track): Promise { const self = this; return new Promise((resolve, reject) => { diff --git a/front/src/environments/environment.ts b/front/src/environments/environment.ts index 8f255f3..594d6df 100644 --- a/front/src/environments/environment.ts +++ b/front/src/environments/environment.ts @@ -37,6 +37,7 @@ const environment_local: Environment = { ssoSignUp: `${serverSSOAddress}/karso/signup/karusic-dev/`, ssoSignOut: `${serverSSOAddress}/karso/signout/karusic-dev/`, tokenStoredInPermanentStorage: false, + replaceDataToRealServer: true, }; const environment_full_local: Environment = {