[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">Videos:</div>
<div class="title" *ngIf="videos.length == 1">Video:</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)"> <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>
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View File

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

View File

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

View File

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

View File

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