[DEBUG] Correct interface

This commit is contained in:
Edouard DUPIN 2022-04-01 22:22:33 +02:00
parent 47e2d1ad7c
commit 3c98b6f4bb
5 changed files with 28 additions and 24 deletions

View File

@ -22,7 +22,7 @@
<div class="title" *ngIf="videos.length > 1">Videos:</div>
<div class="title" *ngIf="videos.length == 1">Video:</div>
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data.id)" (auxclick)="onSelectVideo($event, data.id)">
<app-element-video [id_video]="data.id"></app-element-video>
<app-element-video [idVideo]="data.id"></app-element-video>
</div>
<div class="clear"></div>
</div>

View File

@ -44,12 +44,12 @@ export class TypeScene implements OnInit {
this.arianeService.updateManual(this.route.snapshot.paramMap);
this.typeId = this.arianeService.getTypeId();
let self = this;
console.log(`get parameter id: ${ this.typeId}`);
console.log(`get type global id: ${ this.typeId}`);
this.typeService.get(this.typeId)
.then((response) => {
self.name = response.name;
self.description = response.description;
console.log(` ==> get answer type detail: ${JSON.stringify(response)}`);
if(response.covers === undefined || response.covers === null || response.covers.length === 0) {
self.cover = null;
self.covers = [];
@ -67,17 +67,21 @@ export class TypeScene implements OnInit {
});
this.typeService.getSubSeries(this.typeId, [ 'id', 'name' ])
.then((response) => {
console.log(` ==> get answer sub-series: ${JSON.stringify(response)}`);
self.seriessError = '';
self.seriess = response;
}).catch((response) => {
console.log(` ==> get answer sub-series (ERROR): ${JSON.stringify(response)}`);
self.seriessError = 'Wrong e-mail/login or password';
self.seriess = [];
});
this.typeService.getSubVideo(this.typeId, [ 'id', 'name' ])
.then((response) => {
console.log(` ==> get answer sub-video: ${JSON.stringify(response)}`);
self.videosError = '';
self.videos = response;
}).catch((response) => {
console.log(` ==> get answer sub-video (ERROR): ${JSON.stringify(response)}`);
self.videosError = 'Wrong e-mail/login or password';
self.videos = [];
});

View File

@ -22,21 +22,21 @@ export class VideoScene implements OnInit {
videoGlobal:any;
@ViewChild('globalVideoElement')
set mainDivEl(el: ElementRef) {
if(el !== null) {
if(el !== null && el !== undefined) {
this.videoGlobal = el.nativeElement;
}
}
videoPlayer: HTMLVideoElement;
@ViewChild('videoPlayer')
set mainVideoEl(el: ElementRef) {
if(el !== null) {
if(el !== null && el !== undefined) {
this.videoPlayer = el.nativeElement;
}
}
videoCanva: any;
@ViewChild('canvascreenshoot')
set mainCanvaEl(el: ElementRef) {
if(el !== null) {
if(el !== null && el !== undefined) {
this.videoCanva = el.nativeElement;
}
}

View File

@ -43,7 +43,7 @@ export class SeasonService {
self.bdd.getVideo()
.then((response) => {
// let data = response.getsWhere([["==", "seasonId", id]], ["id", "name", "episode"], ["episode", "name"])
let data = response.gets_where([ [ '==', 'season_id', id ] ], undefined, [ 'episode', 'name' ]);
let data = response.getsWhere([ [ '==', 'seasonId', id ] ], undefined, [ 'episode', 'name' ]);
resolve(data);
}).catch((response) => {
reject(response);
@ -61,8 +61,8 @@ export class SeasonService {
return new Promise((resolve, reject) => {
self.bdd.getVideo()
.then((response) => {
// let data = response.gets_where([["==", "seasonId", _id]], ["id", "name", "episode"], ["episode", "name"])
let data = response.gets_where([ [ '==', 'seasonId', id ] ], undefined, [ 'episode', 'name' ]);
// let data = response.getsWhere([["==", "seasonId", _id]], ["id", "name", "episode"], ["episode", "name"])
let data = response.getsWhere([ [ '==', 'seasonId', id ] ], undefined, [ 'episode', 'name' ]);
resolve(data.length);
}).catch((response) => {
reject(response);

View File

@ -60,7 +60,7 @@ export class TypeService {
return new Promise((resolve, reject) => {
self.bdd.getVideo()
.then((response) => {
let data = response.gets_where([ [ '==', 'typeId', _id ] ], undefined, undefined);
let data = response.getsWhere([ [ '==', 'typeId', _id ] ], undefined, undefined);
resolve(data.length);
}).catch((response) => {
reject(response);
@ -74,16 +74,16 @@ export class TypeService {
self.bdd.getVideo()
.then((response) => {
if(_select.length === 0) {
let data = response.gets_where([ [ '==', 'typeId', _id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], undefined, [ 'name' ]);
let data = response.getsWhere([ [ '==', 'typeId', _id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], undefined, [ 'name' ]);
resolve(data);
return;
}
if(_select[0] === '*') {
let data = response.gets_where([ [ '==', 'typeId', _id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], undefined, [ 'name' ]);
let data = response.getsWhere([ [ '==', 'typeId', _id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], undefined, [ 'name' ]);
resolve(data);
return;
}
let data = response.gets_where([ [ '==', 'typeId', _id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], _select, [ 'name' ]);
let data = response.getsWhere([ [ '==', 'typeId', _id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], _select, [ 'name' ]);
resolve(data);
return;
}).catch((response) => {
@ -92,14 +92,14 @@ export class TypeService {
});
}
getSubSeries(_id:number, _select:Array<string> = []):any {
getSubSeries(id:number, select:string[] = []):any {
let self = this;
/*
return new Promise((resolve, reject) => {
self.bdd.getVideo()
.then(function(response) {
let data = response.gets_where([["==", "typeId", _id], ["!=", "seriesId", null], ["==", "universeId", null]], ["seriesId"], ["name"]);
let data = response.getsWhere([["==", "typeId", _id], ["!=", "seriesId", null], ["==", "universeId", null]], ["seriesId"], ["name"]);
if (_select.length == 0) {
resolve(data);
return;
@ -107,11 +107,11 @@ export class TypeService {
self.bdd.getSeries()
.then(function(response2) {
if (_select[0] == "*") {
let data2 = response2.gets_where([["==", "id", data]], undefined, ["name"]);
let data2 = response2.getsWhere([["==", "id", data]], undefined, ["name"]);
resolve(data2);
return;
}
let data3 = response2.gets_where([["==", "id", data]], _select, ["name"]);
let data3 = response2.getsWhere([["==", "id", data]], _select, ["name"]);
resolve(data3);
return;
}).catch(function(response2) {
@ -125,7 +125,7 @@ export class TypeService {
return new Promise((resolve, reject) => {
self.bdd.getSeries()
.then((response) => {
let data = response.gets_where([ [ '==', 'parentId', _id ] ], undefined, [ 'name' ]);
let data = response.getsWhere([ [ '==', 'parentId', id ] ], undefined, [ 'name' ]);
resolve(data);
}).catch((response) => {
reject(response);
@ -133,24 +133,24 @@ export class TypeService {
});
}
getSubUniverse(_id:number, _select:Array<string> = []):any {
getSubUniverse(id:number, select:string[] = []):any {
let self = this;
return new Promise((resolve, reject) => {
self.bdd.getVideo()
.then((response) => {
let data = response.data.gets_where([ [ '==', 'typeId', _id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], [ 'universId' ], [ 'name' ]);
if(_select.length === 0) {
let data = response.data.getsWhere([ [ '==', 'typeId', id ], [ '==', 'seriesId', null ], [ '==', 'universeId', null ] ], [ 'universId' ], [ 'name' ]);
if(select.length === 0) {
resolve(data);
return;
}
self.bdd.getUniverse()
.then((response2) => {
if(_select[0] === '*') {
let data2 = response2.gets_where([ [ '==', 'id', data ] ], undefined, [ 'name' ]);
if(select[0] === '*') {
let data2 = response2.getsWhere([ [ '==', 'id', data ] ], undefined, [ 'name' ]);
resolve(data2);
return;
}
let data3 = response2.gets_where([ [ '==', 'id', data ] ], _select, [ 'name' ]);
let data3 = response2.getsWhere([ [ '==', 'id', data ] ], select, [ 'name' ]);
resolve(data3);
return;
}).catch((response2) => {