[DEV] global naming refacto and set back ad/remove cove of media and edit media properties

This commit is contained in:
Edouard DUPIN 2020-10-24 00:10:34 +02:00
parent 5f562ad260
commit 768105f1e9
53 changed files with 927 additions and 801 deletions

View File

@ -7,19 +7,19 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; // CLI imports router import { Routes, RouterModule } from '@angular/router'; // CLI imports router
import { ModuleWithProviders } from '@angular/core'; import { ModuleWithProviders } from '@angular/core';
import { HomeComponent } from './scene/home/home'; import { HomeScene } from './scene/home/home';
import { TypeComponent } from './scene/type/type'; import { TypeScene } from './scene/type/type';
import { UniversComponent } from './scene/univers/univers'; import { UniverseScene } from './scene/universe/universe';
import { GroupComponent } from './scene/group/group'; import { SeriesScene } from './scene/series/series';
import { SaisonComponent } from './scene/saison/saison'; import { SeasonScene } from './scene/season/season';
import { VideoComponent } from './scene/video/video'; import { VideoScene } from './scene/video/video';
import { LoginComponent } from './scene/login/login'; import { LoginScene } from './scene/login/login';
import { SignUpComponent } from './scene/sign-up/sign-up'; import { SignUpScene } from './scene/sign-up/sign-up';
import { SettingsComponent } from './scene/settings/settings'; import { SettingsScene } from './scene/settings/settings';
import { UploadScene } from './scene/upload/upload'; import { UploadScene } from './scene/upload/upload';
import { VideoEditComponent } from './scene/video-edit/video-edit'; import { VideoEditScene } from './scene/video-edit/video-edit';
import { GroupEditComponent } from './scene/group-edit/group-edit'; import { SeriesEditScene } from './scene/series-edit/series-edit';
import { SaisonEditComponent } from './scene/saison-edit/saison-edit'; import { SeasonEditScene } from './scene/season-edit/season-edit';
//import { HelpComponent } from './help/help.component'; //import { HelpComponent } from './help/help.component';
// see https://angular.io/guide/router // see https://angular.io/guide/router
@ -27,24 +27,24 @@ import { SaisonEditComponent } from './scene/saison-edit/saison-edit';
const routes: Routes = [ const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full'}, { path: '', redirectTo: '/home', pathMatch: 'full'},
{ path: 'home', component: HomeComponent }, { path: 'home', component: HomeScene },
{ path: 'upload', component: UploadScene }, { path: 'upload', component: UploadScene },
{ path: 'type/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: TypeComponent }, { path: 'type/:universe_id/:type_id/:series_id/:season_id/:video_id', component: TypeScene },
{ path: 'univers/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: UniversComponent }, { path: 'universe/:universe_id/:type_id/:series_id/:season_id/:video_id', component: UniverseScene },
{ path: 'group/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: GroupComponent }, { path: 'series/:universe_id/:type_id/:series_id/:season_id/:video_id', component: SeriesScene },
{ path: 'group-edit/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: GroupEditComponent }, { path: 'series-edit/:universe_id/:type_id/:series_id/:season_id/:video_id', component: SeriesEditScene },
{ path: 'saison/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: SaisonComponent }, { path: 'season/:universe_id/:type_id/:series_id/:season_id/:video_id', component: SeasonScene },
{ path: 'saison-edit/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: SaisonEditComponent }, { path: 'season-edit/:universe_id/:type_id/:series_id/:season_id/:video_id', component: SeasonEditScene },
{ path: 'video/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: VideoComponent }, { path: 'video/:universe_id/:type_id/:series_id/:season_id/:video_id', component: VideoScene },
{ path: 'video-edit/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: VideoEditComponent }, { path: 'video-edit/:universe_id/:type_id/:series_id/:season_id/:video_id', component: VideoEditScene },
{ path: 'login', component: LoginComponent }, { path: 'login', component: LoginScene },
{ path: 'signup', component: SignUpComponent }, { path: 'signup', component: SignUpScene },
{ path: 'settings', component: SettingsComponent }, { path: 'settings', component: SettingsScene },
/*{ path: 'help', component: HelpComponent }*/ /*{ path: 'help', component: HelpComponent }*/
]; ];
/* /*

View File

@ -21,30 +21,30 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { UploadFileComponent } from './component/upload-file/upload-file'; import { UploadFileComponent } from './component/upload-file/upload-file';
import { TopMenuComponent } from './component/top-menu/top-menu'; import { TopMenuComponent } from './component/top-menu/top-menu';
import { ElementTypeComponent } from './component/element-type/element-type'; import { ElementTypeComponent } from './component/element-type/element-type';
import { ElementGroupComponent } from './component/element-group/element-group'; import { ElementSeriesComponent } from './component/element-series/element-series';
import { ElementSaisonComponent } from './component/element-saison/element-saison'; import { ElementSeasonComponent } from './component/element-season/element-season';
import { ElementVideoComponent } from './component/element-video/element-video'; import { ElementVideoComponent } from './component/element-video/element-video';
import { CreateTypeComponent } from './component/create-type/create-type'; import { CreateTypeComponent } from './component/create-type/create-type';
import { PopInUploadProgress } from './component/upload-progress/upload-progress'; import { PopInUploadProgress } from './component/upload-progress/upload-progress';
import { PopInComponent } from './component/popin/popin'; import { PopInComponent } from './component/popin/popin';
import { HelpComponent } from './scene/help/help'; import { HelpScene } from './scene/help/help';
import { LoginComponent } from './scene/login/login'; import { LoginScene } from './scene/login/login';
import { SignUpComponent } from './scene/sign-up/sign-up'; import { SignUpScene } from './scene/sign-up/sign-up';
import { ValidateEmailComponent } from './scene/validate-email/validate-email'; import { ValidateEmailScene } from './scene/validate-email/validate-email';
import { HomeComponent } from './scene/home/home'; import { HomeScene } from './scene/home/home';
import { TypeComponent } from './scene/type/type'; import { TypeScene } from './scene/type/type';
import { UniversComponent } from './scene/univers/univers'; import { UniverseScene } from './scene/universe/universe';
import { GroupComponent } from './scene/group/group'; import { SeriesScene } from './scene/series/series';
import { SaisonComponent } from './scene/saison/saison'; import { SeasonScene } from './scene/season/season';
import { VideoComponent } from './scene/video/video'; import { VideoScene } from './scene/video/video';
import { SettingsComponent } from './scene/settings/settings'; import { SettingsScene } from './scene/settings/settings';
import { ErrorViewerComponent } from './scene/error-viewer/error-viewer'; import { ErrorViewerScene } from './scene/error-viewer/error-viewer';
import { ErrorComponent } from './error/error'; import { ErrorComponent } from './error/error';
import { VideoEditComponent } from './scene/video-edit/video-edit'; import { VideoEditScene } from './scene/video-edit/video-edit';
import { UploadScene } from './scene/upload/upload'; import { UploadScene } from './scene/upload/upload';
import { SaisonEditComponent } from './scene/saison-edit/saison-edit'; import { SeasonEditScene } from './scene/season-edit/season-edit';
import { GroupEditComponent } from './scene/group-edit/group-edit'; import { SeriesEditScene } from './scene/series-edit/series-edit';
import { AuthService } from './service/auth'; import { AuthService } from './service/auth';
import { ArianeService } from './service/ariane'; import { ArianeService } from './service/ariane';
@ -52,15 +52,17 @@ import { CookiesService } from './service/cookies';
import { HttpWrapperService } from './service/http-wrapper'; import { HttpWrapperService } from './service/http-wrapper';
import { HttpOAuthWrapperService } from './service/http-oauth-wrapper'; import { HttpOAuthWrapperService } from './service/http-oauth-wrapper';
import { UserService } from './service/user'; import { UserService } from './service/user';
import { UniversService } from './service/univers'; import { UniverseService } from './service/universe';
import { GroupService } from './service/group'; import { SeriesService } from './service/series';
import { DataService } from './service/data'; import { DataService } from './service/data';
import { TypeService } from './service/type'; import { TypeService } from './service/type';
import { SaisonService } from './service/saison'; import { SeasonService } from './service/season';
import { VideoService } from './service/video'; import { VideoService } from './service/video';
import { SessionService } from './service/session'; import { SessionService } from './service/session';
import { BddService } from './service/bdd'; import { BddService } from './service/bdd';
import { PopInService } from './service/popin'; import { PopInService } from './service/popin';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
@NgModule({ @NgModule({
@ -68,26 +70,26 @@ import { AppComponent } from './app.component';
AppComponent, AppComponent,
TopMenuComponent, TopMenuComponent,
UploadFileComponent, UploadFileComponent,
HelpComponent, HelpScene,
ElementTypeComponent, ElementTypeComponent,
ElementGroupComponent, ElementSeriesComponent,
ElementSaisonComponent, ElementSeasonComponent,
ElementVideoComponent, ElementVideoComponent,
LoginComponent, LoginScene,
SignUpComponent, SignUpScene,
ValidateEmailComponent, ValidateEmailScene,
HomeComponent, HomeScene,
TypeComponent, TypeScene,
UniversComponent, UniverseScene,
GroupComponent, SeriesScene,
SaisonComponent, SeasonScene,
VideoComponent, VideoScene,
SettingsComponent, SettingsScene,
ErrorViewerComponent, ErrorViewerScene,
ErrorComponent, ErrorComponent,
VideoEditComponent, VideoEditScene,
SaisonEditComponent, SeasonEditScene,
GroupEditComponent, SeriesEditScene,
PopInComponent, PopInComponent,
PopInUploadProgress, PopInUploadProgress,
CreateTypeComponent, CreateTypeComponent,
@ -115,9 +117,9 @@ import { AppComponent } from './app.component';
UserService, UserService,
TypeService, TypeService,
DataService, DataService,
UniversService, UniverseService,
GroupService, SeriesService,
SaisonService, SeasonService,
VideoService, VideoService,
ArianeService ArianeService
], ],

View File

@ -7,8 +7,8 @@
</div> </div>
</div> </div>
<div class="saison-small"> <div class="season-small">
Saison {{numberSaison}} Season {{numberSeason}}
</div> </div>
<div class="description-small" *ngIf="count > 1"> <div class="description-small" *ngIf="count > 1">
{{count}} Episodes {{count}} Episodes

View File

@ -9,55 +9,55 @@ import { Injectable, Component, OnInit, Input } from '@angular/core';
import { Router } from "@angular/router"; import { Router } from "@angular/router";
import { ActivatedRoute, Params } from '@angular/router'; import { ActivatedRoute, Params } from '@angular/router';
import { SaisonService } from '../../service/saison'; import { SeasonService } from '../../service/season';
@Component({ @Component({
selector: 'app-element-saison', selector: 'app-element-season',
templateUrl: './element-saison.html', templateUrl: './element-season.html',
styleUrls: ['./element-saison.less'] styleUrls: ['./element-season.less']
}) })
@Injectable() @Injectable()
export class ElementSaisonComponent implements OnInit { export class ElementSeasonComponent implements OnInit {
// input parameters // input parameters
@Input() id_saison:number = -1; @Input() id_season:number = -1;
error:string = ""; error:string = "";
numberSaison:number = -1; numberSeason:number = -1;
count:number = null; count:number = null;
cover:string = ""; cover:string = "";
covers:Array<string> = []; covers:Array<string> = [];
description:string = ""; description:string = "";
constructor(private router: Router, constructor(private router: Router,
private saisonService: SaisonService) { private seasonService: SeasonService) {
} }
ngOnInit() { ngOnInit() {
let self = this; let self = this;
console.log("get saison properties id: " + this.id_saison); console.log("get season properties id: " + this.id_season);
this.saisonService.get(this.id_saison) this.seasonService.get(this.id_season)
.then(function(response) { .then(function(response) {
self.error = ""; self.error = "";
self.numberSaison = response.name; self.numberSeason = response.name;
self.description = response.description; self.description = response.description;
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 = [];
} else { } else {
self.cover = self.saisonService.getCoverThumbnailUrl(response.covers[0]); self.cover = self.seasonService.getCoverThumbnailUrl(response.covers[0]);
for (let iii=0; iii<response.covers.length; iii++) { for (let iii=0; iii<response.covers.length; iii++) {
self.covers.push(self.saisonService.getCoverThumbnailUrl(response.covers[iii])); self.covers.push(self.seasonService.getCoverThumbnailUrl(response.covers[iii]));
} }
} }
}).catch(function(response) { }).catch(function(response) {
self.error = "Can not get the data"; self.error = "Can not get the data";
self.numberSaison = -1 self.numberSeason = -1
self.cover = null; self.cover = null;
self.covers = []; self.covers = [];
self.description = ""; self.description = "";
}); });
this.saisonService.countVideo(this.id_saison) this.seasonService.countVideo(this.id_season)
.then(function(response) { .then(function(response) {
self.count = response; self.count = response;
}).catch(function(response) { }).catch(function(response) {

View File

@ -9,18 +9,18 @@ import { Injectable, Component, OnInit, Input } from '@angular/core';
import { Router } from "@angular/router"; import { Router } from "@angular/router";
import { ActivatedRoute, Params } from '@angular/router'; import { ActivatedRoute, Params } from '@angular/router';
import { GroupService } from '../../service/group'; import { SeriesService } from '../../service/series';
@Component({ @Component({
selector: 'app-element-group', selector: 'app-element-series',
templateUrl: './element-group.html', templateUrl: './element-series.html',
styleUrls: ['./element-group.less'] styleUrls: ['./element-series.less']
}) })
@Injectable() @Injectable()
export class ElementGroupComponent implements OnInit { export class ElementSeriesComponent implements OnInit {
// input parameters // input parameters
@Input() id_group:number = -1; @Input() id_series:number = -1;
@Input() id_type:number = -1; @Input() id_type:number = -1;
error:string = ""; error:string = "";
@ -32,14 +32,14 @@ export class ElementGroupComponent implements OnInit {
covers:Array<string> = []; covers:Array<string> = [];
constructor(private router: Router, constructor(private router: Router,
private groupService: GroupService) { private seriesService: SeriesService) {
} }
ngOnInit() { ngOnInit() {
this.name = "ll " + this.id_type + "+" + this.id_group this.name = "ll " + this.id_type + "+" + this.id_series
let self = this; let self = this;
console.log("get parameter id: " + this.id_type); console.log("get parameter id: " + this.id_type);
this.groupService.get(this.id_group) this.seriesService.get(this.id_series)
.then(function(response) { .then(function(response) {
self.error = ""; self.error = "";
self.name = response.name self.name = response.name
@ -47,9 +47,9 @@ export class ElementGroupComponent implements OnInit {
self.cover = null; self.cover = null;
//self.covers = []; //self.covers = [];
} else { } else {
self.cover = self.groupService.getCoverThumbnailUrl(response.covers[0]); self.cover = self.seriesService.getCoverThumbnailUrl(response.covers[0]);
for (let iii=0; iii<response.covers.length; iii++) { for (let iii=0; iii<response.covers.length; iii++) {
self.covers.push(self.groupService.getCoverThumbnailUrl(response.covers[iii])); self.covers.push(self.seriesService.getCoverThumbnailUrl(response.covers[iii]));
} }
} }
}).catch(function(response) { }).catch(function(response) {

View File

@ -29,8 +29,8 @@ export class ElementVideoComponent implements OnInit {
name:string = ""; name:string = "";
description:string = ""; description:string = "";
episode:number = undefined; episode:number = undefined;
group_id:number = undefined; series_id:number = undefined;
saison_id:number = undefined; season_id:number = undefined;
data_id:number = -1; data_id:number = -1;
time:number = undefined; time:number = undefined;
type_id:number = undefined; type_id:number = undefined;
@ -68,8 +68,8 @@ export class ElementVideoComponent implements OnInit {
} else { } else {
self.episode_display = response.episode + " - "; self.episode_display = response.episode + " - ";
} }
self.group_id = response.serie_id; self.series_id = response.series_id;
self.saison_id = response.saison_id; self.season_id = response.season_id;
self.data_id = response.data_id; self.data_id = response.data_id;
self.time = response.time; self.time = response.time;
self.generated_name = response.generated_name; self.generated_name = response.generated_name;
@ -97,8 +97,8 @@ export class ElementVideoComponent implements OnInit {
self.description = ""; self.description = "";
self.episode = undefined; self.episode = undefined;
self.episode_display = ""; self.episode_display = "";
self.group_id = undefined; self.series_id = undefined;
self.saison_id = undefined; self.season_id = undefined;
self.data_id = -1; self.data_id = -1;
self.time = undefined; self.time = undefined;
self.generated_name = ""; self.generated_name = "";

View File

@ -23,40 +23,40 @@
T T
</div> </div>
</button> </button>
<div class="item_ariane_separator" *ngIf="ariane_univers_id != null && ariane_type_id != null" >/</div> <div class="item_ariane_separator" *ngIf="ariane_universe_id != null && ariane_type_id != null" >/</div>
<button class="item" <button class="item"
*ngIf="ariane_univers_id != null" *ngIf="ariane_universe_id != null"
title="Univers" title="Universe"
(click)="onArianeUnivers($event)" (click)="onArianeUniverse($event)"
(auxclick)="onArianeUnivers($event)"> (auxclick)="onArianeUniverse($event)">
<div class="xdesktop"> <div class="xdesktop">
{{ariane_univers_name}} {{ariane_universe_name}}
</div> </div>
<div class="xmobile"> <div class="xmobile">
U U
</div> </div>
</button> </button>
<div class="item_ariane_separator" *ngIf="ariane_group_id != null && (ariane_univers_id != null || ariane_type_id != null)" >/</div> <div class="item_ariane_separator" *ngIf="ariane_series_id != null && (ariane_universe_id != null || ariane_type_id != null)" >/</div>
<button class="item" <button class="item"
*ngIf="ariane_group_id != null" *ngIf="ariane_series_id != null"
title="Group" title="Series"
(click)="onArianeGroup($event)" (click)="onArianeSeries($event)"
(auxclick)="onArianeGroup($event)"> (auxclick)="onArianeSeries($event)">
<div class="xdesktop"> <div class="xdesktop">
{{ariane_group_name}} {{ariane_series_name}}
</div> </div>
<div class="xmobile"> <div class="xmobile">
G G
</div> </div>
</button> </button>
<div class="item_ariane_separator" *ngIf="ariane_saison_id != null && (ariane_group_id != null || ariane_univers_id != null || ariane_type_id != null)" >/</div> <div class="item_ariane_separator" *ngIf="ariane_season_id != null && (ariane_series_id != null || ariane_universe_id != null || ariane_type_id != null)" >/</div>
<button class="item" <button class="item"
*ngIf="ariane_saison_id != null" *ngIf="ariane_season_id != null"
title="Saison" title="Season"
(click)="onArianeSaison($event)" (click)="onArianeSeason($event)"
(auxclick)="onArianeSaison($event)"> (auxclick)="onArianeSeason($event)">
<div class="xdesktop"> <div class="xdesktop">
{{ariane_saison_name}} {{ariane_season_name}}
</div> </div>
<div class="xmobile"> <div class="xmobile">
S S
@ -145,23 +145,23 @@
<b>Edit Type</b> <b>Edit Type</b>
</button> </button>
<button class="item" <button class="item"
*ngIf="ariane_univers_id != null" *ngIf="ariane_universe_id != null"
(click)="onSubEditUnivers($event)" (click)="onSubEditUniverse($event)"
(auxclick)="onSubEditUnivers($event)"> (auxclick)="onSubEditUniverse($event)">
<b>Edit Univers</b> <b>Edit Universe</b>
</button> </button>
--> -->
<button class="item" <button class="item"
*ngIf="ariane_group_id != null" *ngIf="ariane_series_id != null"
(click)="onSubEditGroup($event)" (click)="onSubEditSeries($event)"
(auxclick)="onSubEditGroup($event)"> (auxclick)="onSubEditSeries($event)">
<b>Edit Group</b> <b>Edit Series</b>
</button> </button>
<button class="item" <button class="item"
*ngIf="ariane_saison_id != null" *ngIf="ariane_season_id != null"
(click)="onSubEditSaison($event)" (click)="onSubEditSeason($event)"
(auxclick)="onSubEditSaison($event)"> (auxclick)="onSubEditSeason($event)">
<b>Edit Saison</b> <b>Edit Season</b>
</button> </button>
<button class="item" <button class="item"
*ngIf="ariane_video_id != null" *ngIf="ariane_video_id != null"
@ -181,23 +181,23 @@
<b>Edit Type</b> <b>Edit Type</b>
</button> </button>
<button class="item" <button class="item"
*ngIf="ariane_univers_id != null" *ngIf="ariane_universe_id != null"
(click)="onSubEditUnivers($event)" (click)="onSubEditUniverse($event)"
(auxclick)="onSubEditUnivers($event)"> (auxclick)="onSubEditUniverse($event)">
<b>Edit Univers</b> <b>Edit Universe</b>
</button> </button>
--> -->
<button class="item" <button class="item"
*ngIf="ariane_group_id != null" *ngIf="ariane_series_id != null"
(click)="onSubEditGroup($event)" (click)="onSubEditSeries($event)"
(auxclick)="onSubEditGroup($event)"> (auxclick)="onSubEditSeries($event)">
<b>Edit Group</b> <b>Edit Series</b>
</button> </button>
<button class="item" <button class="item"
*ngIf="ariane_saison_id != null" *ngIf="ariane_season_id != null"
(click)="onSubEditSaison($event)" (click)="onSubEditSeason($event)"
(auxclick)="onSubEditSaison($event)"> (auxclick)="onSubEditSeason($event)">
<b>Edit Saison</b> <b>Edit Season</b>
</button> </button>
<button class="item" <button class="item"
*ngIf="ariane_video_id != null" *ngIf="ariane_video_id != null"

View File

@ -27,14 +27,14 @@ export class TopMenuComponent implements OnInit {
public ariane_type_id: number = null; public ariane_type_id: number = null;
public ariane_type_name: string = null; public ariane_type_name: string = null;
public ariane_univers_id: number = null; public ariane_universe_id: number = null;
public ariane_univers_name: string = null; public ariane_universe_name: string = null;
public ariane_group_id: number = null; public ariane_series_id: number = null;
public ariane_group_name: string = null; public ariane_series_name: string = null;
public ariane_saison_id: number = null; public ariane_season_id: number = null;
public ariane_saison_name: string = null; public ariane_season_name: string = null;
public ariane_video_id: number = null; public ariane_video_id: number = null;
public ariane_video_name: string = null; public ariane_video_name: string = null;
@ -67,19 +67,19 @@ export class TopMenuComponent implements OnInit {
this.ariane_type_name = this.arianeService.getTypeName(); this.ariane_type_name = this.arianeService.getTypeName();
this.updateEditShow(); this.updateEditShow();
}); });
this.arianeService.univers_change.subscribe(univers_id => { this.arianeService.universe_change.subscribe(univers_id => {
this.ariane_univers_id = univers_id; this.ariane_universe_id = univers_id;
this.ariane_univers_name = this.arianeService.getUniversName(); this.ariane_universe_name = this.arianeService.getUniverseName();
this.updateEditShow(); this.updateEditShow();
}); });
this.arianeService.group_change.subscribe(group_id => { this.arianeService.series_change.subscribe(series_id => {
this.ariane_group_id = group_id; this.ariane_series_id = series_id;
this.ariane_group_name = this.arianeService.getGroupName(); this.ariane_series_name = this.arianeService.getSeriesName();
this.updateEditShow(); this.updateEditShow();
}); });
this.arianeService.saison_change.subscribe(saison_id => { this.arianeService.season_change.subscribe(season_id => {
this.ariane_saison_id = saison_id; this.ariane_season_id = season_id;
this.ariane_saison_name = this.arianeService.getSaisonName(); this.ariane_season_name = this.arianeService.getSeasonName();
this.updateEditShow(); this.updateEditShow();
}); });
this.arianeService.video_change.subscribe(video_id => { this.arianeService.video_change.subscribe(video_id => {
@ -90,9 +90,9 @@ export class TopMenuComponent implements OnInit {
} }
updateEditShow():void { updateEditShow():void {
this.edit_show = /* this.ariane_type_id != null this.edit_show = /* this.ariane_type_id != null
|| this.ariane_univers_id != null || this.ariane_universe_id != null
||*/ this.ariane_group_id != null ||*/ this.ariane_series_id != null
|| this.ariane_saison_id != null || this.ariane_season_id != null
|| this.ariane_video_id != null; || this.ariane_video_id != null;
} }
onAvatar(): void { onAvatar(): void {
@ -112,23 +112,23 @@ export class TopMenuComponent implements OnInit {
this.displayUserMenu = false; this.displayUserMenu = false;
this.arianeService.navigateVideoEdit(this.ariane_video_id, _event.which==2); this.arianeService.navigateVideoEdit(this.ariane_video_id, _event.which==2);
} }
onSubEditSaison(_event: any): void { onSubEditSeason(_event: any): void {
console.log("onSubEdit()"); console.log("onSubEdit()");
this.displayEditMenu = false; this.displayEditMenu = false;
this.displayUserMenu = false; this.displayUserMenu = false;
this.arianeService.navigateSaisonEdit(this.ariane_saison_id, _event.which==2); this.arianeService.navigateSeasonEdit(this.ariane_season_id, _event.which==2);
} }
onSubEditGroup(_event: any): void { onSubEditSeries(_event: any): void {
console.log("onSubEdit()"); console.log("onSubEdit()");
this.displayEditMenu = false; this.displayEditMenu = false;
this.displayUserMenu = false; this.displayUserMenu = false;
this.arianeService.navigateGroupEdit(this.ariane_group_id, _event.which==2); this.arianeService.navigateSeriesEdit(this.ariane_series_id, _event.which==2);
} }
onSubEditUnivers(_event: any): void { onSubEditUniverse(_event: any): void {
console.log("onSubEdit()"); console.log("onSubEdit()");
this.displayEditMenu = false; this.displayEditMenu = false;
this.displayUserMenu = false; this.displayUserMenu = false;
this.arianeService.navigateUniversEdit(this.ariane_univers_id, _event.which==2); this.arianeService.navigateUniverseEdit(this.ariane_universe_id, _event.which==2);
} }
onSubEditType(_event: any): void { onSubEditType(_event: any): void {
console.log("onSubEditType()"); console.log("onSubEditType()");
@ -191,19 +191,19 @@ export class TopMenuComponent implements OnInit {
this.arianeService.navigateType(this.ariane_type_id, _event.which==2); this.arianeService.navigateType(this.ariane_type_id, _event.which==2);
} }
onArianeUnivers(_event: any): void { onArianeUniverse(_event: any): void {
console.log("onArianeUnivers(" + this.ariane_univers_id + ")"); console.log("onArianeUniverse(" + this.ariane_universe_id + ")");
this.arianeService.navigateUnivers(this.ariane_univers_id, _event.which==2); this.arianeService.navigateUniverse(this.ariane_universe_id, _event.which==2);
} }
onArianeGroup(_event: any): void { onArianeSeries(_event: any): void {
console.log("onArianeGroup(" + this.ariane_group_id + ")"); console.log("onArianeSeries(" + this.ariane_series_id + ")");
this.arianeService.navigateGroup(this.ariane_group_id, _event.which==2); this.arianeService.navigateSeries(this.ariane_series_id, _event.which==2);
} }
onArianeSaison(_event: any): void { onArianeSeason(_event: any): void {
console.log("onArianeSaison(" + this.ariane_saison_id + ")"); console.log("onArianeSeason(" + this.ariane_season_id + ")");
this.arianeService.navigateSaison(this.ariane_saison_id, _event.which==2); this.arianeService.navigateSeason(this.ariane_season_id, _event.which==2);
} }
} }

View File

@ -13,7 +13,7 @@ import { ArianeService } from '../../service/ariane';
templateUrl: './error-viewer.html', templateUrl: './error-viewer.html',
styleUrls: ['./error-viewer.less'] styleUrls: ['./error-viewer.less']
}) })
export class ErrorViewerComponent implements OnInit { export class ErrorViewerScene implements OnInit {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private arianeService: ArianeService) { } private arianeService: ArianeService) { }

View File

@ -7,7 +7,7 @@ import { ArianeService } from '../../service/ariane';
templateUrl: './help.html', templateUrl: './help.html',
styleUrls: ['./help.less'] styleUrls: ['./help.less']
}) })
export class HelpComponent implements OnInit { export class HelpScene implements OnInit {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private arianeService: ArianeService) { } private arianeService: ArianeService) { }

View File

@ -11,7 +11,6 @@ import { fadeInAnimation } from '../../_animations/index';
import { TypeService } from '../../service/type'; import { TypeService } from '../../service/type';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
import { environment } from 'environments/environment';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -20,7 +19,7 @@ import { environment } from 'environments/environment';
animations: [fadeInAnimation], animations: [fadeInAnimation],
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class HomeComponent implements OnInit { export class HomeScene implements OnInit {
data_list = []; data_list = [];
error = ""; error = "";
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,

View File

@ -50,7 +50,7 @@ declare function SHA512(param1: any): any;
animations: [fadeInAnimation], animations: [fadeInAnimation],
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class LoginComponent implements OnInit { export class LoginScene implements OnInit {
public loginOK:boolean = false; public loginOK:boolean = false;
public loginHelp:string = ""; public loginHelp:string = "";
public login:string = ""; public login:string = "";

View File

@ -6,7 +6,7 @@
</div> </div>
<div class="input"> <div class="input">
<input type="number" <input type="number"
placeholder="Id of the saison" placeholder="Id of the season"
[value]="numberVal" [value]="numberVal"
(input)="onNumber($event.target.value)" (input)="onNumber($event.target.value)"
/> />

View File

@ -11,7 +11,7 @@ import { NgForm } from '@angular/forms';
import { FormGroup, FormControl } from "@angular/forms"; import { FormGroup, FormControl } from "@angular/forms";
import { fadeInAnimation } from '../../_animations/index'; import { fadeInAnimation } from '../../_animations/index';
import { SaisonService } from '../../service/saison'; import { SeasonService } from '../../service/season';
import { DataService } from '../../service/data'; import { DataService } from '../../service/data';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
@ -25,15 +25,15 @@ export class ElementList {
} }
@Component({ @Component({
selector: 'app-saison-edit', selector: 'app-season-edit',
templateUrl: './saison-edit.html', templateUrl: './season-edit.html',
styleUrls: ['./saison-edit.less'], styleUrls: ['./season-edit.less'],
animations: [fadeInAnimation], animations: [fadeInAnimation],
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
// https://www.sitepoint.com/angular-forms/ // https://www.sitepoint.com/angular-forms/
export class SaisonEditComponent implements OnInit { export class SeasonEditScene implements OnInit {
id_saison:number = -1; id_season:number = -1;
error:string = ""; error:string = "";
@ -49,23 +49,23 @@ export class SaisonEditComponent implements OnInit {
private router: Router, private router: Router,
private locate: Location, private locate: Location,
private dataService: DataService, private dataService: DataService,
private saisonService: SaisonService, private seasonService: SeasonService,
private arianeService: ArianeService) { private arianeService: ArianeService) {
} }
ngOnInit() { ngOnInit() {
this.arianeService.updateManual(this.route.snapshot.paramMap); this.arianeService.updateManual(this.route.snapshot.paramMap);
this.id_saison = this.arianeService.getSaisonId(); this.id_season = this.arianeService.getSeasonId();
let self = this; let self = this;
this.saisonService.get(this.id_saison) this.seasonService.get(this.id_season)
.then(function(response) { .then(function(response) {
console.log("get response of saison : " + JSON.stringify(response, null, 2)); console.log("get response of season : " + JSON.stringify(response, null, 2));
self.numberVal = response.number; self.numberVal = response.number;
self.description = response.description; self.description = response.description;
if (response.covers !== undefined && response.covers !== null) { if (response.covers !== undefined && response.covers !== null) {
for (let iii=0; iii<response.covers.length; iii++) { for (let iii=0; iii<response.covers.length; iii++) {
self.covers_display.push(self.saisonService.getCoverUrl(response.covers[iii])); self.covers_display.push(self.seasonService.getCoverUrl(response.covers[iii]));
} }
} else { } else {
self.covers_display = [] self.covers_display = []
@ -93,7 +93,7 @@ export class SaisonEditComponent implements OnInit {
"number": this.numberVal, "number": this.numberVal,
"description": this.description "description": this.description
}; };
this.saisonService.put(this.id_saison, data); this.seasonService.put(this.id_season, data);
} }
// At the drag drop area // At the drag drop area
@ -127,12 +127,12 @@ export class SaisonEditComponent implements OnInit {
let self = this; let self = this;
this.dataService.sendFile(_file) this.dataService.sendFile(_file)
.then(function(response) { .then(function(response) {
console.log("get response of saison : " + JSON.stringify(response, null, 2)); console.log("get response of season : " + JSON.stringify(response, null, 2));
let id_of_image = response.id; let id_of_image = response.id;
self.saisonService.addCover(self.id_saison, id_of_image) self.seasonService.addCover(self.id_season, id_of_image)
.then(function(response) { .then(function(response) {
console.log("cover added"); console.log("cover added");
self.covers_display.push(self.saisonService.getCoverUrl(id_of_image)); self.covers_display.push(self.seasonService.getCoverUrl(id_of_image));
}).catch(function(response) { }).catch(function(response) {
console.log("Can not cover in the cover_list..."); console.log("Can not cover in the cover_list...");
}); });

View File

@ -1,9 +1,9 @@
<div class="generic-page"> <div class="generic-page">
<div *ngIf="group_name" class="title"> <div *ngIf="series_name" class="title">
{{group_name}} {{series_name}}
</div> </div>
<div class="sub-title-main"> <div class="sub-title-main">
Saison {{name}} Season {{name}}
</div> </div>
<div class="cover" *ngIf="cover != null" > <div class="cover" *ngIf="cover != null" >
<img src="{{cover}}"/> <img src="{{cover}}"/>

View File

@ -9,79 +9,77 @@ import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { fadeInAnimation } from '../../_animations/index'; import { fadeInAnimation } from '../../_animations/index';
import { SaisonService } from '../../service/saison'; import { SeasonService } from '../../service/season';
import { GroupService } from '../../service/group'; import { SeriesService } from '../../service/series';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
import { environment } from 'environments/environment';
@Component({ @Component({
selector: 'app-saison', selector: 'app-season',
templateUrl: './saison.html', templateUrl: './season.html',
styleUrls: ['./saison.less'], styleUrls: ['./season.less'],
animations: [fadeInAnimation], animations: [fadeInAnimation],
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class SeasonScene implements OnInit {
export class SaisonComponent implements OnInit {
name: string = ""; name: string = "";
group_name: string = ""; series_name: string = "";
description: string = ""; description: string = "";
group_id: number = null; series_id: number = null;
cover: string = "" cover: string = ""
covers: Array<string> = [] covers: Array<string> = []
id_saison = -1; id_season = -1;
videos_error = ""; videos_error = "";
videos = []; videos = [];
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private locate: Location, private locate: Location,
private saisonService: SaisonService, private seasonService: SeasonService,
private groupService: GroupService, private seriesService: SeriesService,
private arianeService: ArianeService) { private arianeService: ArianeService) {
} }
ngOnInit() { ngOnInit() {
console.log("ngOnInit(SaisonComponent)"); console.log("ngOnInit(SeasonComponent)");
this.arianeService.updateManual(this.route.snapshot.paramMap); this.arianeService.updateManual(this.route.snapshot.paramMap);
this.id_saison = this.arianeService.getSaisonId(); this.id_season = this.arianeService.getSeasonId();
let self = this; let self = this;
this.saisonService.get(this.id_saison) this.seasonService.get(this.id_season)
.then(function(response) { .then(function(response:any) {
self.name = response.name; self.name = response.name;
self.group_id = response.parent_id; self.series_id = response.parent_id;
self.description = response.description; self.description = response.description;
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 = [];
} else { } else {
self.cover = self.groupService.getCoverUrl(response.covers[0]); self.cover = self.seriesService.getCoverUrl(response.covers[0]);
for (let iii=0; iii<response.covers.length; iii++) { for (let iii=0; iii<response.covers.length; iii++) {
self.covers.push(self.groupService.getCoverUrl(response.covers[iii])); self.covers.push(self.seriesService.getCoverUrl(response.covers[iii]));
} }
} }
self.groupService.get(self.group_id) self.seriesService.get(self.series_id)
.then(function(response) { .then(function(response:any) {
self.group_name = response.name; self.series_name = response.name;
}).catch(function(response) { }).catch(function(response:any) {
self.group_name = ""; self.series_name = "";
}); });
}).catch(function(response) { }).catch(function(response:any) {
self.description = ""; self.description = "";
self.name = "???"; self.name = "???";
self.group_name = ""; self.series_name = "";
self.group_id = null; self.series_id = null;
self.cover = null; self.cover = null;
self.covers = []; self.covers = [];
}); });
console.log("get parameter id: " + this.id_saison); console.log("get parameter id: " + this.id_season);
this.saisonService.getVideo(this.id_saison) this.seasonService.getVideo(this.id_season)
.then(function(response) { .then(function(response:any) {
self.videos_error = ""; self.videos_error = "";
self.videos = response self.videos = response
}).catch(function(response) { }).catch(function(response:any) {
self.videos_error = "Can not get the List of video without saison"; self.videos_error = "Can not get the List of video without season";
self.videos = [] self.videos = []
}); });
} }

View File

@ -6,7 +6,7 @@
</div> </div>
<div class="input"> <div class="input">
<input type="text" <input type="text"
placeholder="Name of the Group" placeholder="Name of the Series"
[value]="name" [value]="name"
(input)="onName($event.target.value)" (input)="onName($event.target.value)"
/> />

View File

@ -11,7 +11,7 @@ import { NgForm } from '@angular/forms';
import { FormGroup, FormControl } from "@angular/forms"; import { FormGroup, FormControl } from "@angular/forms";
import { fadeInAnimation } from '../../_animations/index'; import { fadeInAnimation } from '../../_animations/index';
import { GroupService } from '../../service/group'; import { SeriesService } from '../../service/series';
import { DataService } from '../../service/data'; import { DataService } from '../../service/data';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
@ -25,15 +25,15 @@ export class ElementList {
} }
@Component({ @Component({
selector: 'app-group-edit', selector: 'app-series-edit',
templateUrl: './group-edit.html', templateUrl: './series-edit.html',
styleUrls: ['./group-edit.less'], styleUrls: ['./series-edit.less'],
animations: [fadeInAnimation], animations: [fadeInAnimation],
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
// https://www.sitepoint.com/angular-forms/ // https://www.sitepoint.com/angular-forms/
export class GroupEditComponent implements OnInit { export class SeriesEditScene implements OnInit {
id_group:number = -1; id_series:number = -1;
error:string = "" error:string = ""
@ -49,23 +49,23 @@ export class GroupEditComponent implements OnInit {
private router: Router, private router: Router,
private locate: Location, private locate: Location,
private dataService: DataService, private dataService: DataService,
private groupService: GroupService, private seriesService: SeriesService,
private arianeService: ArianeService) { private arianeService: ArianeService) {
} }
ngOnInit() { ngOnInit() {
this.arianeService.updateManual(this.route.snapshot.paramMap); this.arianeService.updateManual(this.route.snapshot.paramMap);
this.id_group = this.arianeService.getGroupId(); this.id_series = this.arianeService.getSeriesId();
let self = this; let self = this;
this.groupService.get(this.id_group) this.seriesService.get(this.id_series)
.then(function(response) { .then(function(response) {
console.log("get response of video : " + JSON.stringify(response, null, 2)); console.log("get response of video : " + JSON.stringify(response, null, 2));
self.name = response.name; self.name = response.name;
self.description = response.description; self.description = response.description;
if (response.covers !== undefined && response.covers !== null) { if (response.covers !== undefined && response.covers !== null) {
for (let iii=0; iii<response.covers.length; iii++) { for (let iii=0; iii<response.covers.length; iii++) {
self.covers_display.push(self.groupService.getCoverUrl(response.covers[iii])); self.covers_display.push(self.seriesService.getCoverUrl(response.covers[iii]));
} }
} else { } else {
self.covers_display = [] self.covers_display = []
@ -93,7 +93,7 @@ export class GroupEditComponent implements OnInit {
"name": this.name, "name": this.name,
"description": this.description "description": this.description
}; };
this.groupService.put(this.id_group, data); this.seriesService.put(this.id_series, data);
} }
// At the drag drop area // At the drag drop area
@ -129,10 +129,10 @@ export class GroupEditComponent implements OnInit {
.then(function(response) { .then(function(response) {
console.log("get response of video : " + JSON.stringify(response, null, 2)); console.log("get response of video : " + JSON.stringify(response, null, 2));
let id_of_image = response.id; let id_of_image = response.id;
self.groupService.addCover(self.id_group, id_of_image) self.seriesService.addCover(self.id_series, id_of_image)
.then(function(response) { .then(function(response) {
console.log("cover added"); console.log("cover added");
self.covers_display.push(self.groupService.getCoverUrl(id_of_image)); self.covers_display.push(self.seriesService.getCoverUrl(id_of_image));
}).catch(function(response) { }).catch(function(response) {
console.log("Can not cover in the cover_list..."); console.log("Can not cover in the cover_list...");
}); });

View File

@ -8,10 +8,10 @@
<div class="description" *ngIf="description"> <div class="description" *ngIf="description">
{{description}} {{description}}
</div> </div>
<div class="fill-all colomn_mutiple" *ngIf="saisons.length != 0"> <div class="fill-all colomn_mutiple" *ngIf="seasons.length != 0">
<div class="sub-title">Saisons:</div> <div class="sub-title">Seasons:</div>
<div *ngFor="let data of saisons" class="item-list" (click)="onSelectSaison($event, data.id)" (auxclick)="onSelectSaison($event, data.id)"> <div *ngFor="let data of seasons" class="item-list" (click)="onSelectSeason($event, data.id)" (auxclick)="onSelectSeason($event, data.id)">
<app-element-saison [id_saison]="data.id"></app-element-saison> <app-element-season [id_season]="data.id"></app-element-season>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View File

@ -9,45 +9,44 @@ import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { fadeInAnimation } from '../../_animations/index'; import { fadeInAnimation } from '../../_animations/index';
import { GroupService } from '../../service/group'; import { SeriesService } from '../../service/series';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
import { environment } from 'environments/environment';
@Component({ @Component({
selector: 'app-group', selector: 'app-series',
templateUrl: './group.html', templateUrl: './series.html',
styleUrls: ['./group.less'], styleUrls: ['./series.less'],
animations: [fadeInAnimation], animations: [fadeInAnimation],
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class GroupComponent implements OnInit { export class SeriesScene implements OnInit {
//id_type = -1; //id_type = -1;
//id_univers = -1; //id_universe = -1;
id_group = -1; id_series = -1;
name: string = ""; name: string = "";
description: string = ""; description: string = "";
cover: string = "" cover: string = ""
covers: Array<string> = [] covers: Array<string> = []
saisons_error: string = ""; seasons_error: string = "";
saisons: Array<number> = []; seasons: Array<number> = [];
videos_error: string = ""; videos_error: string = "";
videos: Array<number> = []; videos: Array<number> = [];
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private locate: Location, private locate: Location,
private groupService: GroupService, private seriesService: SeriesService,
private arianeService: ArianeService) { private arianeService: ArianeService) {
} }
ngOnInit() { ngOnInit() {
this.arianeService.updateManual(this.route.snapshot.paramMap); this.arianeService.updateManual(this.route.snapshot.paramMap);
//this.id_univers = parseInt(this.route.snapshot.paramMap.get('univers_id')); //this.id_universe = parseInt(this.route.snapshot.paramMap.get('univers_id'));
//this.id_type = parseInt(this.route.snapshot.paramMap.get('type_id')); //this.id_type = parseInt(this.route.snapshot.paramMap.get('type_id'));
this.id_group = this.arianeService.getGroupId(); this.id_series = this.arianeService.getSeriesId();
let self = this; let self = this;
this.groupService.get(this.id_group) this.seriesService.get(this.id_series)
.then(function(response) { .then(function(response) {
self.name = response.name; self.name = response.name;
self.description = response.description; self.description = response.description;
@ -55,9 +54,9 @@ export class GroupComponent implements OnInit {
self.cover = null; self.cover = null;
self.covers = []; self.covers = [];
} else { } else {
self.cover = self.groupService.getCoverUrl(response.covers[0]); self.cover = self.seriesService.getCoverUrl(response.covers[0]);
for (let iii=0; iii<response.covers.length; iii++) { for (let iii=0; iii<response.covers.length; iii++) {
self.covers.push(self.groupService.getCoverUrl(response.covers[iii])); self.covers.push(self.seriesService.getCoverUrl(response.covers[iii]));
} }
} }
}).catch(function(response) { }).catch(function(response) {
@ -66,26 +65,26 @@ export class GroupComponent implements OnInit {
self.cover = null; self.cover = null;
self.covers = []; self.covers = [];
}); });
console.log("get parameter id: " + this.id_group); console.log("get parameter id: " + this.id_series);
this.groupService.getSaison(this.id_group, ["id", "name"]) this.seriesService.getSeason(this.id_series, ["id", "name"])
.then(function(response) { .then(function(response) {
self.saisons_error = ""; self.seasons_error = "";
self.saisons = response self.seasons = response
}).catch(function(response) { }).catch(function(response) {
self.saisons_error = "Can not get the list of saison in this group"; self.seasons_error = "Can not get the list of season in this series";
self.saisons = [] self.seasons = []
}); });
this.groupService.getVideo(this.id_group) this.seriesService.getVideo(this.id_series)
.then(function(response) { .then(function(response) {
self.videos_error = ""; self.videos_error = "";
self.videos = response self.videos = response
}).catch(function(response) { }).catch(function(response) {
self.videos_error = "Can not get the List of video without saison"; self.videos_error = "Can not get the List of video without season";
self.videos = [] self.videos = []
}); });
} }
onSelectSaison(_event: any, _idSelected: number):void { onSelectSeason(_event: any, _idSelected: number):void {
this.arianeService.navigateSaison(_idSelected, _event.which==2); this.arianeService.navigateSeason(_idSelected, _event.which==2);
} }
onSelectVideo(_event: any, _idSelected: number):void { onSelectVideo(_event: any, _idSelected: number):void {

View File

@ -13,7 +13,7 @@ import { ArianeService } from '../../service/ariane';
templateUrl: './settings.html', templateUrl: './settings.html',
styleUrls: ['./settings.less'] styleUrls: ['./settings.less']
}) })
export class SettingsComponent implements OnInit { export class SettingsScene implements OnInit {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private arianeService: ArianeService) { } private arianeService: ArianeService) { }

View File

@ -20,7 +20,7 @@ import { ArianeService } from '../../service/ariane';
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class SignUpComponent implements OnInit { export class SignUpScene implements OnInit {
private signUp_iconWrong:string = "icon-right-not-validate"; private signUp_iconWrong:string = "icon-right-not-validate";
private signUp_iconWait:string = "icon-right-load"; private signUp_iconWait:string = "icon-right-load";

View File

@ -9,8 +9,8 @@
{{description}} {{description}}
</div> </div>
<div class="fill-all colomn_mutiple"> <div class="fill-all colomn_mutiple">
<div *ngFor="let data of groups" class="item" (click)="onSelectGroup($event, data.id)" (auxclick)="onSelectGroup($event, data.id)"> <div *ngFor="let data of seriess" class="item" (click)="onSelectSeries($event, data.id)" (auxclick)="onSelectSeries($event, data.id)">
<app-element-group [id_type]="type_id" [id_group]="data.id"></app-element-group> <app-element-series [id_type]="type_id" [id_series]="data.id"></app-element-series>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View File

@ -11,7 +11,7 @@ import { fadeInAnimation } from '../../_animations/index';
import { TypeService } from '../../service/type'; import { TypeService } from '../../service/type';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
import { environment } from 'environments/environment'; import { environment } from '../../../environments/environment';
@Component({ @Component({
selector: 'app-type', selector: 'app-type',
@ -21,13 +21,13 @@ import { environment } from 'environments/environment';
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class TypeComponent implements OnInit { export class TypeScene implements OnInit {
type_id = -1; type_id = -1;
name: string = ""; name: string = "";
description: string = ""; description: string = "";
cover:string = null; cover:string = null;
groups_error = ""; seriess_error = "";
groups = []; seriess = [];
videos_error = ""; videos_error = "";
videos = []; videos = [];
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
@ -58,13 +58,13 @@ export class TypeComponent implements OnInit {
self.name = "???"; self.name = "???";
self.description = ""; self.description = "";
}); });
this.typeService.getSubGroup(this.type_id, ["id", "name"]) this.typeService.getSubSeries(this.type_id, ["id", "name"])
.then(function(response) { .then(function(response) {
self.groups_error = ""; self.seriess_error = "";
self.groups = response self.seriess = response
}).catch(function(response) { }).catch(function(response) {
self.groups_error = "Wrong e-mail/login or password"; self.seriess_error = "Wrong e-mail/login or password";
self.groups = [] self.seriess = []
}); });
this.typeService.getSubVideo(this.type_id, ["id", "name"]) this.typeService.getSubVideo(this.type_id, ["id", "name"])
.then(function(response) { .then(function(response) {
@ -75,8 +75,8 @@ export class TypeComponent implements OnInit {
self.videos = [] self.videos = []
}); });
} }
onSelectGroup(_event: any, _idSelected: number):void { onSelectSeries(_event: any, _idSelected: number):void {
this.arianeService.navigateGroup(_idSelected, _event.which==2); this.arianeService.navigateSeries(_idSelected, _event.which==2);
} }
onSelectVideo(_event: any, _idSelected: number):void { onSelectVideo(_event: any, _idSelected: number):void {

View File

@ -9,43 +9,43 @@ import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { fadeInAnimation } from '../../_animations/index'; import { fadeInAnimation } from '../../_animations/index';
import { UniversService } from '../../service/univers'; import { UniverseService } from '../../service/universe';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
import { environment } from 'environments/environment'; import { environment } from '../../../environments/environment';
@Component({ @Component({
selector: 'app-univers', selector: 'app-universe',
templateUrl: './univers.html', templateUrl: './universe.html',
styleUrls: ['./univers.less'], styleUrls: ['./universe.less'],
animations: [fadeInAnimation], animations: [fadeInAnimation],
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class UniversComponent implements OnInit { export class UniverseScene implements OnInit {
univers_id = -1; universe_id = -1;
videos_error = ""; videos_error = "";
videos = []; videos = [];
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private locate: Location, private locate: Location,
private universService: UniversService, private universeService: UniverseService,
private arianeService: ArianeService) { private arianeService: ArianeService) {
} }
ngOnInit() { ngOnInit() {
this.arianeService.updateManual(this.route.snapshot.paramMap); this.arianeService.updateManual(this.route.snapshot.paramMap);
this.univers_id = this.arianeService.getUniversId(); this.universe_id = this.arianeService.getUniverseId();
let self = this; let self = this;
console.log("get parameter id: " + this.univers_id); console.log("get parameter id: " + this.universe_id);
/* /*
this.universService.getVideo(this.univers_id) this.universeService.getVideo(this.univers_id)
.then(function(response) { .then(function(response) {
self.videos_error = ""; self.videos_error = "";
self.videos = response self.videos = response
}).catch(function(response) { }).catch(function(response) {
self.videos_error = "Can not get the List of video without saison"; self.videos_error = "Can not get the List of video without season";
self.videos = [] self.videos = []
}); });
*/ */

View File

@ -78,8 +78,8 @@
<div class="input"> <div class="input">
<input type="text" <input type="text"
placeholder="Series of the Media" placeholder="Series of the Media"
[value]="parse_serie" [value]="parse_series"
(input)="onSerie($event.target.value)" (input)="onSeries($event.target.value)"
/> />
</div> </div>
</div> </div>
@ -88,15 +88,15 @@
==&gt; ==&gt;
</div> </div>
<div class="input"> <div class="input">
<!-- <ngx-select-dropdown [config]="config" [options]="listGroup2" <!-- <ngx-select-dropdown [config]="config" [options]="listSeries2"
[(ngModel)]="parse_serie" [multiple]="false" ></ngx-select-dropdown>--> [(ngModel)]="parse_series" [multiple]="false" ></ngx-select-dropdown>-->
<select [ngModel]="serie_id" <select [ngModel]="series_id"
(ngModelChange)="onChangeGroup($event)"> (ngModelChange)="onChangeSeries($event)">
<option *ngFor="let element of listGroup" [ngValue]="element.value">{{element.label}}</option> <option *ngFor="let element of listSeries" [ngValue]="element.value">{{element.label}}</option>
</select> </select>
</div> </div>
<!-- <div class="input_add"> <!-- <div class="input_add">
<button class="button color-button-normal color-shadow-black" (click)="newSerie()" type="submit"> <button class="button color-button-normal color-shadow-black" (click)="newSeries()" type="submit">
<i class="material-icons">add_circle_outline</i> <i class="material-icons">add_circle_outline</i>
</button> </button>
</div>--> </div>-->
@ -108,9 +108,9 @@
<div class="input"> <div class="input">
<input type="number" <input type="number"
pattern="[0-9]{0-4}" pattern="[0-9]{0-4}"
placeholder="saison of the Media" placeholder="season of the Media"
[value]="parse_saison" [value]="parse_season"
(input)="onSaison($event.target.value)" (input)="onSeason($event.target.value)"
/> />
</div> </div>
</div> </div>

View File

@ -16,8 +16,8 @@ import { HttpEventType, HttpResponse } from '@angular/common/http';
import { PopInService } from '../../service/popin'; import { PopInService } from '../../service/popin';
import { TypeService } from '../../service/type'; import { TypeService } from '../../service/type';
import { UniversService } from '../../service/univers'; import { UniverseService } from '../../service/universe';
import { GroupService } from '../../service/group'; import { SeriesService } from '../../service/series';
import { VideoService } from '../../service/video'; import { VideoService } from '../../service/video';
import { DataService } from '../../service/data'; import { DataService } from '../../service/data';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
@ -49,7 +49,7 @@ export class UploadScene implements OnInit {
upload_file_value: string = "" upload_file_value: string = ""
selectedFiles: FileList; selectedFiles: FileList;
type_id: number = undefined type_id: number = undefined
serie_id: number = undefined series_id: number = undefined
need_send: boolean = false; need_send: boolean = false;
covers_display: Array<any> = []; covers_display: Array<any> = [];
@ -65,14 +65,14 @@ export class UploadScene implements OnInit {
listType: ElementList[] = [ listType: ElementList[] = [
{ value: undefined, label: '---' }, { value: undefined, label: '---' },
]; ];
listUnivers: ElementList[] = [ listUniverse: ElementList[] = [
{ value: undefined, label: '---' }, { value: undefined, label: '---' },
{ value: null, label: '---' }, { value: null, label: '---' },
]; ];
listGroup: ElementList[] = [ listSeries: ElementList[] = [
{ value: undefined, label: '---' }, { value: undefined, label: '---' },
]; ];
listGroup2 = [{ id: undefined, description: '---' }]; listSeries2 = [{ id: undefined, description: '---' }];
/* /*
config = { config = {
displayKey: "label", // if objects array passed which key to be displayed defaults to description displayKey: "label", // if objects array passed which key to be displayed defaults to description
@ -92,12 +92,12 @@ export class UploadScene implements OnInit {
searchPlaceholder: 'Search', // label thats displayed in search input, searchPlaceholder: 'Search', // label thats displayed in search input,
searchOnKey: 'description', // key on which search should be performed this will be selective search. if undefined this will be extensive search on all keys searchOnKey: 'description', // key on which search should be performed this will be selective search. if undefined this will be extensive search on all keys
} }
listSaison: ElementList[] = [ listSeason: ElementList[] = [
{ value: undefined, label: '---' }, { value: undefined, label: '---' },
]; ];
parse_universe: string = ""; parse_universe: string = "";
parse_serie: string = ""; parse_series: string = "";
parse_saison: number = null; parse_season: number = null;
parse_episode: number = null; parse_episode: number = null;
parse_title: string = ""; parse_title: string = "";
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
@ -105,8 +105,8 @@ export class UploadScene implements OnInit {
private locate: Location, private locate: Location,
private dataService: DataService, private dataService: DataService,
private typeService: TypeService, private typeService: TypeService,
private universService: UniversService, private universeService: UniverseService,
private groupService: GroupService, private seriesService: SeriesService,
private videoService: VideoService, private videoService: VideoService,
private httpService: HttpWrapperService, private httpService: HttpWrapperService,
private arianeService: ArianeService, private arianeService: ArianeService,
@ -134,13 +134,13 @@ export class UploadScene implements OnInit {
this.id_video = this.arianeService.getVideoId(); this.id_video = this.arianeService.getVideoId();
let self = this; let self = this;
this.listType = [{ value: undefined, label: '---' }]; this.listType = [{ value: undefined, label: '---' }];
this.listUnivers = [{ value: undefined, label: '---' }]; this.listUniverse = [{ value: undefined, label: '---' }];
this.listGroup = [{ value: undefined, label: '---' }]; this.listSeries = [{ value: undefined, label: '---' }];
this.listSaison = [{ value: undefined, label: '---' }]; this.listSeason = [{ value: undefined, label: '---' }];
this.universService.getData() this.universeService.getData()
.then(function (response2) { .then(function (response2) {
for (let iii = 0; iii < response2.length; iii++) { for (let iii = 0; iii < response2.length; iii++) {
self.listUnivers.push({ value: response2[iii].id, label: response2[iii].name }); self.listUniverse.push({ value: response2[iii].id, label: response2[iii].name });
} }
}).catch(function (response2) { }).catch(function (response2) {
console.log("get response22 : " + JSON.stringify(response2, null, 2)); console.log("get response22 : " + JSON.stringify(response2, null, 2));
@ -153,12 +153,12 @@ export class UploadScene implements OnInit {
}).catch(function (response2) { }).catch(function (response2) {
console.log("get response22 : " + JSON.stringify(response2, null, 2)); console.log("get response22 : " + JSON.stringify(response2, null, 2));
}); });
//this.groupService.getOrder() //this.seriesService.getOrder()
this.groupService.getData() this.seriesService.getData()
.then(function (response3) { .then(function (response3) {
for (let iii = 0; iii < response3.length; iii++) { for (let iii = 0; iii < response3.length; iii++) {
self.listGroup.push({ value: response3[iii].id, label: response3[iii].name }); self.listSeries.push({ value: response3[iii].id, label: response3[iii].name });
//console.log("Get serie: " + response3[iii].id + ", label:" + response3[iii].name) //console.log("Get series: " + response3[iii].id + ", label:" + response3[iii].name)
} }
}).catch(function (response3) { }).catch(function (response3) {
console.log("get response3 : " + JSON.stringify(response3, null, 2)); console.log("get response3 : " + JSON.stringify(response3, null, 2));
@ -170,13 +170,13 @@ export class UploadScene implements OnInit {
self.data.name = response.name; self.data.name = response.name;
self.data.description = response.description; self.data.description = response.description;
self.data.episode = response.episode; self.data.episode = response.episode;
self.data.univers_id = response.univers_id; self.data.universe_id = response.univers_id;
self.data.data_id = response.data_id; self.data.data_id = response.data_id;
self.data.time = response.time; self.data.time = response.time;
self.data.generated_name = response.generated_name; self.data.generated_name = response.generated_name;
self.onChangeType(response.type_id); self.onChangeType(response.type_id);
self.onChangeGroup(response.serie_id); self.onChangeSeries(response.series_id);
self.data.saison_id = response.saison_id; self.data.season_id = response.season_id;
self.data_ori = self.data.clone(); self.data_ori = self.data.clone();
if (response.covers !== undefined && response.covers !== null) { if (response.covers !== undefined && response.covers !== null) {
for (let iii = 0; iii < response.covers.length; iii++) { for (let iii = 0; iii < response.covers.length; iii++) {
@ -205,18 +205,18 @@ export class UploadScene implements OnInit {
onChangeType (_value: any): void { onChangeType (_value: any): void {
console.log("Change requested of type ... " + _value); console.log("Change requested of type ... " + _value);
this.type_id = _value; this.type_id = _value;
//this.data.serie_id = null; //this.data.series_id = null;
//this.data.saison_id = null; //this.data.season_id = null;
//this.listGroup = [{value: undefined, label: '---'}]; //this.listSeries = [{value: undefined, label: '---'}];
//this.listSaison = [{value: undefined, label: '---'}]; //this.listSeason = [{value: undefined, label: '---'}];
let self = this; let self = this;
this.updateNeedSend(); this.updateNeedSend();
/* /*
if (this.type_id != undefined) { if (this.type_id != undefined) {
self.typeService.getSubGroup(this.type_id, ["id", "name"]) self.typeService.getSubSeries(this.type_id, ["id", "name"])
.then(function(response2) { .then(function(response2) {
for(let iii= 0; iii < response2.length; iii++) { for(let iii= 0; iii < response2.length; iii++) {
self.listGroup.push({value: response2[iii].id, label: response2[iii].name}); self.listSeries.push({value: response2[iii].id, label: response2[iii].name});
} }
}).catch(function(response2) { }).catch(function(response2) {
console.log("get response22 : " + JSON.stringify(response2, null, 2)); console.log("get response22 : " + JSON.stringify(response2, null, 2));
@ -225,22 +225,22 @@ export class UploadScene implements OnInit {
*/ */
} }
onChangeGroup (_value: any): void { onChangeSeries (_value: any): void {
this.serie_id = _value; this.series_id = _value;
if (_value === undefined || _value === null) { if (_value === undefined || _value === null) {
} else { } else {
for (let iii = 0 ; iii<this.listGroup.length ; iii++) { for (let iii = 0 ; iii<this.listSeries.length ; iii++) {
if (this.listGroup[iii].value == _value) { if (this.listSeries[iii].value == _value) {
this.parse_serie = this.listGroup[iii].label; this.parse_series = this.listSeries[iii].label;
break; break;
} }
} }
} }
this.updateNeedSend(); this.updateNeedSend();
} }
onSaison (_value: any): void { onSeason (_value: any): void {
this.parse_saison = _value; this.parse_season = _value;
this.updateNeedSend(); this.updateNeedSend();
} }
@ -258,17 +258,17 @@ export class UploadScene implements OnInit {
this.parse_episode = parseInt(_value.value, 10); this.parse_episode = parseInt(_value.value, 10);
this.updateNeedSend(); this.updateNeedSend();
} }
onSerie (_value: any): void { onSeries (_value: any): void {
this.parse_serie = _value; this.parse_series = _value;
let self = this; let self = this;
if (this.parse_serie != "") { if (this.parse_series != "") {
this.groupService.getLike(this.parse_serie) this.seriesService.getLike(this.parse_series)
.then(function(response) { .then(function(response) {
console.log("find elemet: " + response.name + " " + response.id); console.log("find elemet: " + response.name + " " + response.id);
self.serie_id = response.id; self.series_id = response.id;
}).catch(function(response) { }).catch(function(response) {
console.log("CAN NOT find element: " ); console.log("CAN NOT find element: " );
self.serie_id = null; self.series_id = null;
}); });
} }
this.updateNeedSend(); this.updateNeedSend();
@ -297,8 +297,8 @@ export class UploadScene implements OnInit {
// (change)="selectFile($event)" // (change)="selectFile($event)"
onChangeFile (_value: any): void { onChangeFile (_value: any): void {
this.parse_universe = ""; this.parse_universe = "";
this.parse_serie = ""; this.parse_series = "";
this.parse_saison = null; this.parse_season = null;
this.parse_episode = null; this.parse_episode = null;
this.parse_title = ""; this.parse_title = "";
this.selectedFiles = _value.files this.selectedFiles = _value.files
@ -309,7 +309,7 @@ export class UploadScene implements OnInit {
this.parse_title = splitElement[0]; this.parse_title = splitElement[0];
} else { } else {
if (splitElement.length>=2) { if (splitElement.length>=2) {
this.parse_serie = splitElement[0]; this.parse_series = splitElement[0];
} }
splitElement.splice(0,1); splitElement.splice(0,1);
if (splitElement.length == 1) { if (splitElement.length == 1) {
@ -318,10 +318,10 @@ export class UploadScene implements OnInit {
while (splitElement.length>0) { while (splitElement.length>0) {
let element = splitElement[0]; let element = splitElement[0];
let find = false; let find = false;
if (this.parse_saison == null) { if (this.parse_season == null) {
if (element.length >= 1 && (element[0] == 's' || element[0] == 'S') ) { if (element.length >= 1 && (element[0] == 's' || element[0] == 'S') ) {
element = element.substring(1); element = element.substring(1);
this.parse_saison = parseInt(element, 10); this.parse_season = parseInt(element, 10);
find = true; find = true;
} }
} }
@ -333,7 +333,7 @@ export class UploadScene implements OnInit {
} }
} }
if (find == false) { if (find == false) {
if (this.parse_saison == null && this.parse_episode == null) { if (this.parse_season == null && this.parse_episode == null) {
if (this.parse_universe == "") { if (this.parse_universe == "") {
this.parse_universe = element; this.parse_universe = element;
} else { } else {
@ -357,11 +357,11 @@ export class UploadScene implements OnInit {
this.updateNeedSend(); this.updateNeedSend();
let self = this; let self = this;
if (this.parse_serie != "") { if (this.parse_series != "") {
this.groupService.getLike(this.parse_serie) this.seriesService.getLike(this.parse_series)
.then(function(response) { .then(function(response) {
console.log("find elemet: " + response.name + " " + response.id); console.log("find elemet: " + response.name + " " + response.id);
self.serie_id = response.id; self.series_id = response.id;
}).catch(function(response) { }).catch(function(response) {
console.log("CAN NOT find element: " ); console.log("CAN NOT find element: " );
}); });
@ -378,34 +378,34 @@ export class UploadScene implements OnInit {
let self = this; let self = this;
/* /*
this.parse_serie = ""; this.parse_series = "";
this.parse_saison = null; this.parse_season = null;
this.parse_episode = null; this.parse_episode = null;
this.parse_title = ""; this.parse_title = "";
*/ */
// clean uopload labels // clean upload labels
this.uploadMediaSendSize = 0; this.uploadMediaSendSize = 0;
this.uploadMediaSize = 0; this.uploadMediaSize = 0;
this.uploadLabelMediaTitle = ""; this.uploadLabelMediaTitle = "";
this.uploadResult = null; this.uploadResult = null;
this.uploadError = null; this.uploadError = null;
// add univers // add universe
if (this.parse_universe != null) { if (this.parse_universe != null) {
this.uploadLabelMediaTitle += this.parse_universe; this.uploadLabelMediaTitle += this.parse_universe;
} }
// add serie // add series
if (this.parse_serie != null) { if (this.parse_series != null) {
if (this.uploadLabelMediaTitle.length != 0) { if (this.uploadLabelMediaTitle.length != 0) {
this.uploadLabelMediaTitle += "/"; this.uploadLabelMediaTitle += "/";
} }
this.uploadLabelMediaTitle += this.parse_serie; this.uploadLabelMediaTitle += this.parse_series;
} }
// add saison // add season
if (this.parse_saison != null) { if (this.parse_season != null) {
if (this.uploadLabelMediaTitle.length != 0) { if (this.uploadLabelMediaTitle.length != 0) {
this.uploadLabelMediaTitle += "-"; this.uploadLabelMediaTitle += "-";
} }
this.uploadLabelMediaTitle += "s" + this.parse_saison.toString(); this.uploadLabelMediaTitle += "s" + this.parse_season.toString();
} }
// add episode ID // add episode ID
if (this.parse_episode != null) { if (this.parse_episode != null) {
@ -423,8 +423,8 @@ export class UploadScene implements OnInit {
this.popInService.open("popin-upload-progress"); this.popInService.open("popin-upload-progress");
this.videoService.uploadFile(_file, this.videoService.uploadFile(_file,
this.parse_universe, this.parse_universe,
this.parse_serie, this.parse_series,
this.parse_saison, this.parse_season,
this.parse_episode, this.parse_episode,
this.parse_title, this.parse_title,
this.type_id, this.type_id,
@ -458,38 +458,38 @@ export class UploadScene implements OnInit {
}); });
} }
eventPopUpSaison (_event: string): void { eventPopUpSeason (_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-saison"); this.popInService.close("popin-new-season");
} }
eventPopUpSerie (_event: string): void { eventPopUpSeries (_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-serie"); this.popInService.close("popin-new-series");
} }
eventPopUpType (_event: string): void { eventPopUpType (_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-type"); this.popInService.close("popin-new-type");
} }
eventPopUpUnivers (_event: string): void { eventPopUpUniverse (_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-univers"); this.popInService.close("popin-new-universe");
} }
newSaison (): void { newSeason (): void {
console.log("Request new Saison..."); console.log("Request new Season...");
this.popInService.open("popin-new-saison"); this.popInService.open("popin-new-season");
} }
newSerie (): void { newSeries (): void {
console.log("Request new Serie..."); console.log("Request new Series...");
this.popInService.open("popin-new-serie"); this.popInService.open("popin-new-series");
} }
newType (): void { newType (): void {
console.log("Request new Type..."); console.log("Request new Type...");
this.popInService.open("popin-create-type"); this.popInService.open("popin-create-type");
} }
newUnivers () { newUniverse () {
console.log("Request new Univers..."); console.log("Request new Universe...");
this.popInService.open("popin-new-univers"); this.popInService.open("popin-new-universe");
} }
} }

View File

@ -7,7 +7,7 @@ import { ArianeService } from '../../service/ariane';
templateUrl: './validate-email.html', templateUrl: './validate-email.html',
styleUrls: ['./validate-email.less'] styleUrls: ['./validate-email.less']
}) })
export class ValidateEmailComponent implements OnInit { export class ValidateEmailScene implements OnInit {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private arianeService: ArianeService private arianeService: ArianeService

View File

@ -57,48 +57,48 @@
</div> </div>
<div class="request_raw"> <div class="request_raw">
<div class="label"> <div class="label">
Univers: Universe:
</div> </div>
<div class="input"> <div class="input">
<select [ngModel]="data.univers_id" <select [ngModel]="data.universe_id"
(ngModelChange)="onChangeUnivers($event)"> (ngModelChange)="onChangeUniverse($event)">
<option *ngFor="let element of listUnivers" [ngValue]="element.value">{{element.label}}</option> <option *ngFor="let element of listUniverse" [ngValue]="element.value">{{element.label}}</option>
</select> </select>
</div> </div>
<div class="input_add"> <div class="input_add">
<button class="button color-button-normal color-shadow-black" (click)="newUnivers()" type="submit"> <button class="button color-button-normal color-shadow-black" (click)="newUniverse()" type="submit">
<i class="material-icons">add_circle_outline</i> <i class="material-icons">add_circle_outline</i>
</button> </button>
</div> </div>
</div> </div>
<div class="request_raw"> <div class="request_raw">
<div class="label"> <div class="label">
Serie: Series:
</div> </div>
<div class="input"> <div class="input">
<select [ngModel]="data.serie_id" <select [ngModel]="data.series_id"
(ngModelChange)="onChangeGroup($event)"> (ngModelChange)="onChangeSeries($event)">
<option *ngFor="let element of listGroup" [ngValue]="element.value">{{element.label}}</option> <option *ngFor="let element of listSeries" [ngValue]="element.value">{{element.label}}</option>
</select> </select>
</div> </div>
<div class="input_add"> <div class="input_add">
<button class="button color-button-normal color-shadow-black" (click)="newSerie()" type="submit"> <button class="button color-button-normal color-shadow-black" (click)="newSeries()" type="submit">
<i class="material-icons">add_circle_outline</i> <i class="material-icons">add_circle_outline</i>
</button> </button>
</div> </div>
</div> </div>
<div class="request_raw"> <div class="request_raw">
<div class="label"> <div class="label">
Saison: Season:
</div> </div>
<div class="input"> <div class="input">
<select [ngModel]="data.saison_id" <select [ngModel]="data.season_id"
(ngModelChange)="onChangeSaison($event)"> (ngModelChange)="onChangeSeason($event)">
<option *ngFor="let element of listSaison" [ngValue]="element.value">{{element.label}}</option> <option *ngFor="let element of listSeason" [ngValue]="element.value">{{element.label}}</option>
</select> </select>
</div> </div>
<div class="input_add"> <div class="input_add">
<button class="button color-button-normal color-shadow-black" (click)="newSaison()" type="submit"> <button class="button color-button-normal color-shadow-black" (click)="newSeason()" type="submit">
<i class="material-icons">add_circle_outline</i> <i class="material-icons">add_circle_outline</i>
</button> </button>
</div> </div>
@ -170,38 +170,46 @@
<create-type ></create-type> <create-type ></create-type>
<popin id="popin-new-saison" <upload-progress [mediaTitle]="uploadLabelMediaTitle"
popTitle="Create a new saison" [mediaUploaded]="uploadMediaSendSize"
[mediaSize]="uploadMediaSize"
[result]="uploadResult"
[error]="uploadError"></upload-progress>
<popin id="popin-new-season"
popTitle="Create a new season"
closeTopRight="true" closeTopRight="true"
closeTitle="Cancel" closeTitle="Cancel"
validateTitle="Create" validateTitle="Create"
(callback)="eventPopUpSaison($event[0])"> (callback)="eventPopUpSeason($event[0])">
<p> <p>
Name: <!-- <input type="text" [(ngModel)]="bodyText" /> --> Name: <!-- <input type="text" [(ngModel)]="bodyText" /> -->
</p> </p>
</popin> </popin>
<popin id="popin-new-serie" <popin id="popin-new-series"
popSize="small" popSize="small"
popTitle="Create a new serie" popTitle="Create a new series"
closeTopRight="true" closeTopRight="true"
closeTitle="Cancel" closeTitle="Cancel"
validateTitle="Create" validateTitle="Create"
(callback)="eventPopUpSerie($event[0])"> (callback)="eventPopUpSeries($event[0])">
<p> <p>
Name: <!-- <input type="text" [(ngModel)]="bodyText" /> --> Name: <!-- <input type="text" [(ngModel)]="bodyText" /> -->
</p> </p>
</popin> </popin>
<popin id="popin-new-univers" <popin id="popin-new-universe"
popSize="big" popSize="big"
popTitle="Create a new univers" popTitle="Create a new universe"
closeTopRight="true" closeTopRight="true"
closeTitle="Cancel" closeTitle="Cancel"
validateTitle="Create" validateTitle="Create"
(callback)="eventPopUpUnivers($event[0])"> (callback)="eventPopUpUniverse($event[0])">
<p> <p>
Name: <!-- <input type="text" [(ngModel)]="bodyText" /> --> Name: <!-- <input type="text" [(ngModel)]="bodyText" /> -->
</p> </p>
</popin> </popin>

View File

@ -16,8 +16,9 @@ import { HttpEventType, HttpResponse} from '@angular/common/http';
import { PopInService } from '../../service/popin'; import { PopInService } from '../../service/popin';
import { TypeService } from '../../service/type'; import { TypeService } from '../../service/type';
import { UniversService } from '../../service/univers'; import { UniverseService } from '../../service/universe';
import { GroupService } from '../../service/group'; import { SeriesService } from '../../service/series';
import { SeasonService } from '../../service/season';
import { VideoService } from '../../service/video'; import { VideoService } from '../../service/video';
import { DataService } from '../../service/data'; import { DataService } from '../../service/data';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
@ -36,12 +37,12 @@ class DataToSend {
name:string = "" name:string = ""
description:string = "" description:string = ""
episode:number = undefined episode:number = undefined
univers_id:number = undefined universe_id:number = null
serie_id:number = undefined series_id:number = null
saison_id:number = undefined season_id:number = null
data_id:number = -1 data_id:number = -1
time:number = undefined time:number = undefined
type_id:number = undefined type_id:number = null
covers:Array<any> = []; covers:Array<any> = [];
generated_name:string = "" generated_name:string = ""
clone() { clone() {
@ -49,9 +50,9 @@ class DataToSend {
tmp.name = this.name tmp.name = this.name
tmp.description = this.description tmp.description = this.description
tmp.episode = this.episode tmp.episode = this.episode
tmp.univers_id = this.univers_id tmp.universe_id = this.universe_id
tmp.serie_id = this.serie_id tmp.series_id = this.series_id
tmp.saison_id = this.saison_id tmp.season_id = this.season_id
tmp.data_id = this.data_id tmp.data_id = this.data_id
tmp.time = this.time tmp.time = this.time
tmp.type_id = this.type_id tmp.type_id = this.type_id
@ -69,7 +70,7 @@ class DataToSend {
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
// https://www.sitepoint.com/angular-forms/ // https://www.sitepoint.com/angular-forms/
export class VideoEditComponent implements OnInit { export class VideoEditScene implements OnInit {
id_video:number = -1; id_video:number = -1;
error:string = "" error:string = ""
@ -81,19 +82,28 @@ export class VideoEditComponent implements OnInit {
selectedFiles:FileList; selectedFiles:FileList;
need_send:boolean = false; need_send:boolean = false;
// section tha define the upload value to display in the pop-in of upload
uploadLabelMediaTitle: string = "";
uploadMediaSendSize: number = 0;
uploadMediaSize: number = 0;
uploadResult: string = null;
uploadError: string = null;
covers_display:Array<any> = []; covers_display:Array<any> = [];
listType: ElementList[] = [ listType: ElementList[] = [
{value: undefined, label: '---'}, {value: undefined, label: '---'},
]; ];
listUnivers: ElementList[] = [ listUniverse: ElementList[] = [
{value: undefined, label: '---'}, {value: undefined, label: '---'},
{value: null, label: '---'}, {value: null, label: '---'},
]; ];
listGroup: ElementList[] = [ listSeries: ElementList[] = [
{value: undefined, label: '---'}, {value: undefined, label: '---'},
]; ];
listSaison: ElementList[] = [ listSeason: ElementList[] = [
{value: undefined, label: '---'}, {value: undefined, label: '---'},
]; ];
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
@ -101,8 +111,9 @@ export class VideoEditComponent implements OnInit {
private locate: Location, private locate: Location,
private dataService: DataService, private dataService: DataService,
private typeService: TypeService, private typeService: TypeService,
private universService: UniversService, private universeService: UniverseService,
private groupService: GroupService, private seriesService: SeriesService,
private seasonService: SeasonService,
private videoService: VideoService, private videoService: VideoService,
private httpService: HttpWrapperService, private httpService: HttpWrapperService,
private arianeService: ArianeService, private arianeService: ArianeService,
@ -127,30 +138,45 @@ export class VideoEditComponent implements OnInit {
if (this.data.type_id != this.data_ori.type_id) { if (this.data.type_id != this.data_ori.type_id) {
this.need_send = true; this.need_send = true;
} }
if (this.data.univers_id != this.data_ori.univers_id) { if (this.data.universe_id != this.data_ori.universe_id) {
this.need_send = true; this.need_send = true;
} }
if (this.data.serie_id != this.data_ori.serie_id) { if (this.data.series_id != this.data_ori.series_id) {
this.need_send = true; this.need_send = true;
} }
if (this.data.saison_id != this.data_ori.saison_id) { if (this.data.season_id != this.data_ori.season_id) {
this.need_send = true; this.need_send = true;
} }
return this.need_send; return this.need_send;
} }
updateCoverList(_covers: any) {
this.covers_display = [];
this.data.covers = [];
if (_covers !== undefined && _covers !== null) {
for (let iii=0; iii<_covers.length; iii++) {
this.data.covers.push(_covers[iii]);
this.covers_display.push({
id:_covers[iii],
url:this.videoService.getCoverThumbnailUrl(_covers[iii])
});
}
} else {
this.covers_display = []
}
}
ngOnInit() { ngOnInit() {
this.arianeService.updateManual(this.route.snapshot.paramMap); this.arianeService.updateManual(this.route.snapshot.paramMap);
this.id_video = this.arianeService.getVideoId(); this.id_video = this.arianeService.getVideoId();
let self = this; let self = this;
this.listType = [{value: undefined, label: '---'}]; this.listType = [{value: null, label: '---'}];
this.listUnivers = [{value: undefined, label: '---'}]; this.listUniverse = [{value: null, label: '---'}];
this.listGroup = [{value: undefined, label: '---'}]; this.listSeries = [{value: null, label: '---'}];
this.listSaison = [{value: undefined, label: '---'}]; this.listSeason = [{value: null, label: '---'}];
this.universService.getData() this.universeService.getData()
.then(function(response2) { .then(function(response2) {
for(let iii= 0; iii < response2.length; iii++) { for(let iii= 0; iii < response2.length; iii++) {
self.listUnivers.push({value: response2[iii].id, label: response2[iii].name}); self.listUniverse.push({value: response2[iii].id, label: response2[iii].name});
} }
}).catch(function(response2) { }).catch(function(response2) {
console.log("get response22 : " + JSON.stringify(response2, null, 2)); console.log("get response22 : " + JSON.stringify(response2, null, 2));
@ -163,12 +189,12 @@ export class VideoEditComponent implements OnInit {
}).catch(function(response2) { }).catch(function(response2) {
console.log("get response22 : " + JSON.stringify(response2, null, 2)); console.log("get response22 : " + JSON.stringify(response2, null, 2));
}); });
//this.groupService.getOrder() //this.seriesService.getOrder()
this.groupService.getData() this.seriesService.getData()
.then(function(response3) { .then(function(response3) {
for(let iii= 0; iii < response3.length; iii++) { for(let iii= 0; iii < response3.length; iii++) {
self.listGroup.push({value: response3[iii].id, label: response3[iii].name}); self.listSeries.push({value: response3[iii].id, label: response3[iii].name});
console.log("[" + self.data.data_id + "] Get serie: " + response3[iii].id + ", label:" + response3[iii].name) console.log("[" + self.data.data_id + "] Get series: " + response3[iii].id + ", label:" + response3[iii].name)
} }
}).catch(function(response3) { }).catch(function(response3) {
console.log("get response3 : " + JSON.stringify(response3, null, 2)); console.log("get response3 : " + JSON.stringify(response3, null, 2));
@ -179,25 +205,27 @@ export class VideoEditComponent implements OnInit {
self.data.name = response.name; self.data.name = response.name;
self.data.description = response.description; self.data.description = response.description;
self.data.episode = response.episode; self.data.episode = response.episode;
self.data.univers_id = response.univers_id; self.data.universe_id = response.univers_id;
if (self.data.universe_id === undefined) {
self.data.universe_id = null;
}
self.data.data_id = response.data_id; self.data.data_id = response.data_id;
self.data.time = response.time; self.data.time = response.time;
self.data.generated_name = response.generated_name; self.data.generated_name = response.generated_name;
self.onChangeType(response.type_id); self.onChangeType(response.type_id);
self.onChangeGroup(response.serie_id); if (self.data.type_id === undefined) {
self.data.saison_id = response.saison_id; self.data.type_id = null;
self.data_ori = self.data.clone();
if (response.covers !== undefined && response.covers !== null) {
for (let iii=0; iii<response.covers.length; iii++) {
self.data.covers.push(response.covers[iii]);
self.covers_display.push({
id:response.covers[iii],
url:self.videoService.getCoverUrl(response.covers[iii])
});
}
} else {
self.covers_display = []
} }
self.onChangeSeries(response.series_id);
if (self.data.series_id === undefined) {
self.data.series_id = null;
}
self.data.season_id = response.season_id;
if (self.data.season_id === undefined) {
self.data.season_id = null;
}
self.data_ori = self.data.clone();
self.updateCoverList(response.covers);
self.updateNeedSend(); self.updateNeedSend();
console.log("covers_list : " + JSON.stringify(self.covers_display, null, 2)); console.log("covers_list : " + JSON.stringify(self.covers_display, null, 2));
}).catch(function(response) { }).catch(function(response) {
@ -212,18 +240,18 @@ export class VideoEditComponent implements OnInit {
onChangeType(_value:any):void { onChangeType(_value:any):void {
console.log("Change requested of type ... " + _value); console.log("Change requested of type ... " + _value);
this.data.type_id = _value; this.data.type_id = _value;
//this.data.serie_id = null; //this.data.series_id = null;
//this.data.saison_id = null; //this.data.season_id = null;
//this.listGroup = [{value: undefined, label: '---'}]; //this.listSeries = [{value: undefined, label: '---'}];
//this.listSaison = [{value: undefined, label: '---'}]; //this.listSeason = [{value: undefined, label: '---'}];
let self = this; let self = this;
this.updateNeedSend(); this.updateNeedSend();
/* /*
if (this.type_id != undefined) { if (this.type_id != undefined) {
self.typeService.getSubGroup(this.type_id, ["id", "name"]) self.typeService.getSubSeries(this.type_id, ["id", "name"])
.then(function(response2) { .then(function(response2) {
for(let iii= 0; iii < response2.length; iii++) { for(let iii= 0; iii < response2.length; iii++) {
self.listGroup.push({value: response2[iii].id, label: response2[iii].name}); self.listSeries.push({value: response2[iii].id, label: response2[iii].name});
} }
}).catch(function(response2) { }).catch(function(response2) {
console.log("get response22 : " + JSON.stringify(response2, null, 2)); console.log("get response22 : " + JSON.stringify(response2, null, 2));
@ -232,21 +260,21 @@ export class VideoEditComponent implements OnInit {
*/ */
} }
onChangeUnivers(_value:any):void { onChangeUniverse(_value:any):void {
this.data.univers_id = _value; this.data.universe_id = _value;
this.updateNeedSend(); this.updateNeedSend();
} }
onChangeGroup(_value:any):void { onChangeSeries(_value:any):void {
this.data.serie_id = _value; this.data.series_id = _value;
this.data.saison_id = null; this.data.season_id = null;
this.listSaison = [{value: undefined, label: '---'}]; this.listSeason = [{value: undefined, label: '---'}];
let self = this; let self = this;
if (this.data.serie_id != undefined) { if (this.data.series_id != undefined) {
self.groupService.getSaison(this.data.serie_id, ["id", "name"]) self.seriesService.getSeason(this.data.series_id, ["id", "name"])
.then(function(response3) { .then(function(response3) {
for(let iii= 0; iii < response3.length; iii++) { for(let iii= 0; iii < response3.length; iii++) {
self.listSaison.push({value: response3[iii].id, label: "saison " + response3[iii].name}); self.listSeason.push({value: response3[iii].id, label: "season " + response3[iii].name});
} }
}).catch(function(response3) { }).catch(function(response3) {
console.log("get response22 : " + JSON.stringify(response3, null, 2)); console.log("get response22 : " + JSON.stringify(response3, null, 2));
@ -254,8 +282,8 @@ export class VideoEditComponent implements OnInit {
} }
this.updateNeedSend(); this.updateNeedSend();
} }
onChangeSaison(_value:any):void { onChangeSeason(_value:any):void {
this.data.saison_id = _value; this.data.season_id = _value;
this.updateNeedSend(); this.updateNeedSend();
} }
@ -278,6 +306,9 @@ export class VideoEditComponent implements OnInit {
} else { } else {
this.data.time = _value.value; this.data.time = _value.value;
} }
if (this.data.time < 10) {
this.data.time = null;
}
this.updateNeedSend(); this.updateNeedSend();
} }
@ -306,16 +337,32 @@ export class VideoEditComponent implements OnInit {
data["time"] = this.data.time; data["time"] = this.data.time;
} }
if (this.data.type_id != this.data_ori.type_id) { if (this.data.type_id != this.data_ori.type_id) {
data["type_id"] = this.data.type_id; if (this.data.type_id == undefined) {
data["type_id"] = null;
} else {
data["type_id"] = this.data.type_id;
}
} }
if (this.data.univers_id != this.data_ori.univers_id) { if (this.data.universe_id != this.data_ori.universe_id) {
data["univers_id"] = this.data.univers_id; if (this.data.universe_id == undefined) {
data["universe_id"] = null;
} else {
data["universe_id"] = this.data.universe_id;
}
} }
if (this.data.serie_id != this.data_ori.serie_id) { if (this.data.series_id != this.data_ori.series_id) {
data["serie_id"] = this.data.serie_id; if (this.data.series_id == undefined) {
data["series_id"] = null;
} else {
data["series_id"] = this.data.series_id;
}
} }
if (this.data.saison_id != this.data_ori.saison_id) { if (this.data.season_id != this.data_ori.season_id) {
data["saison_id"] = this.data.saison_id; if (this.data.season_id == undefined) {
data["season_id"] = null;
} else {
data["season_id"] = this.data.season_id;
}
} }
let tmpp = this.data.clone(); let tmpp = this.data.clone();
let self = this; let self = this;
@ -333,7 +380,8 @@ export class VideoEditComponent implements OnInit {
// (drop)="onDropFile($event)" // (drop)="onDropFile($event)"
onDropFile(_event: DragEvent) { onDropFile(_event: DragEvent) {
_event.preventDefault(); _event.preventDefault();
this.uploadFile(_event.dataTransfer.files[0]); //TODO : this.uploadFile(_event.dataTransfer.files[0]);
console.log("error in drag & drop ...");
} }
// At the drag drop area // At the drag drop area
@ -349,34 +397,53 @@ export class VideoEditComponent implements OnInit {
this.selectedFiles = _value.files this.selectedFiles = _value.files
this.coverFile = this.selectedFiles[0]; this.coverFile = this.selectedFiles[0];
console.log("select file " + this.coverFile.name); console.log("select file " + this.coverFile.name);
this.uploadFile(this.coverFile); this.uploadCover(this.coverFile);
this.updateNeedSend(); this.updateNeedSend();
} }
uploadFile(_file:File) { uploadCover(_file:File) {
if (_file == undefined) { if (_file == undefined) {
console.log("No file selected!"); console.log("No file selected!");
return; return;
} }
let self = this; let self = this;
this.dataService.sendFile(_file) // clean upload labels
.then(function(response) { this.uploadMediaSendSize = 0;
console.log("get response of video : " + JSON.stringify(response, null, 2)); this.uploadMediaSize = 0;
let id_of_image = response.id; this.uploadLabelMediaTitle = "";
self.videoService.addCover(self.id_video, id_of_image) this.uploadResult = null;
.then(function(response) { this.uploadError = null;
console.log("cover added"); // display the upload pop-in
self.covers_display.push(self.videoService.getCoverUrl(id_of_image)); this.popInService.open("popin-upload-progress");
}).catch(function(response) { this.videoService.uploadCover(_file, this.id_video, function(count, total) {
console.log("Can not cover in the cover_list..."); self.uploadMediaSendSize = count;
}); self.uploadMediaSize = total;
}).catch(function(response) { })
//self.error = "Can not get the data"; .then(function (response:any) {
console.log("Can not add the data in the system..."); console.log("get response of cover : " + JSON.stringify(response, null, 2));
}); self.uploadResult = "Cover added done";
// TODO: we retrive the whiole media ==> update data ...
self.updateCoverList(response.covers);
}).catch(function (response:any) {
//self.error = "Can not get the data";
console.log("Can not add the cover in the video...");
self.uploadError = "Error in the upload of the cover..." + JSON.stringify(response, null, 2);
});
} }
removeCover(_id) { removeCover(_id:number) {
console.log("Request remove cover: " + _id); console.log("Request remove cover: " + _id);
let self = this;
this.videoService.deleteCover(this.id_video, _id)
.then(function (response:any) {
console.log("get response of remove cover : " + JSON.stringify(response, null, 2));
self.uploadResult = "Cover remove done";
// TODO: we retrive the whiole media ==> update data ...
self.updateCoverList(response.covers);
}).catch(function (response:any) {
//self.error = "Can not get the data";
console.log("Can not remove the cover of the video...");
self.uploadError = "Error in the upload of the cover..." + JSON.stringify(response, null, 2);
});
} }
removeMedia() { removeMedia() {
console.log("Request remove Media..."); console.log("Request remove Media...");
@ -390,38 +457,38 @@ export class VideoEditComponent implements OnInit {
}); });
} }
eventPopUpSaison(_event: string): void { eventPopUpSeason(_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-saison"); this.popInService.close("popin-new-season");
} }
eventPopUpSerie(_event: string): void { eventPopUpSeries(_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-serie"); this.popInService.close("popin-new-series");
} }
eventPopUpType(_event: string): void { eventPopUpType(_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-type"); this.popInService.close("popin-new-type");
} }
eventPopUpUnivers(_event: string): void { eventPopUpUniverse(_event: string): void {
console.log("GET event: " + _event); console.log("GET event: " + _event);
this.popInService.close("popin-new-univers"); this.popInService.close("popin-new-universe");
} }
newSaison(): void { newSeason(): void {
console.log("Request new Saison..."); console.log("Request new Season...");
this.popInService.open("popin-new-saison"); this.popInService.open("popin-new-season");
} }
newSerie(): void { newSeries(): void {
console.log("Request new Serie..."); console.log("Request new Series...");
this.popInService.open("popin-new-serie"); this.popInService.open("popin-new-series");
} }
newType(): void { newType(): void {
console.log("Request new Type..."); console.log("Request new Type...");
this.popInService.open("popin-create-type"); this.popInService.open("popin-create-type");
} }
newUnivers() { newUniverse() {
console.log("Request new Univers..."); console.log("Request new Universe...");
this.popInService.open("popin-new-univers"); this.popInService.open("popin-new-universe");
} }
} }

View File

@ -6,11 +6,11 @@
<div class="cover" *ngIf="cover != null" > <div class="cover" *ngIf="cover != null" >
<img src="{{cover}}"/> <img src="{{cover}}"/>
</div> </div>
<div class="episode" *ngIf="group_name!=null"> <div class="episode" *ngIf="series_name!=null">
<b>Serie:</b> {{group_name}} <b>Series:</b> {{series_name}}
</div> </div>
<div class="episode" *ngIf="saison_name!=null"> <div class="episode" *ngIf="season_name!=null">
<b>Saison:</b> {{saison_name}} <b>Season:</b> {{season_name}}
</div> </div>
<div class="episode" *ngIf="episode!=null"> <div class="episode" *ngIf="episode!=null">
<b>Episode:</b> {{episode}} <b>Episode:</b> {{episode}}

View File

@ -10,8 +10,8 @@ import { Location } from '@angular/common';
import { fadeInAnimation } from '../../_animations/index'; import { fadeInAnimation } from '../../_animations/index';
import { HttpWrapperService } from '../../service/http-wrapper'; import { HttpWrapperService } from '../../service/http-wrapper';
import { VideoService } from '../../service/video'; import { VideoService } from '../../service/video';
import { GroupService } from '../../service/group'; import { SeriesService } from '../../service/series';
import { SaisonService } from '../../service/saison'; import { SeasonService } from '../../service/season';
import { ArianeService } from '../../service/ariane'; import { ArianeService } from '../../service/ariane';
@Component({ @Component({
@ -22,7 +22,7 @@ import { ArianeService } from '../../service/ariane';
host: { '[@fadeInAnimation]': '' } host: { '[@fadeInAnimation]': '' }
}) })
export class VideoComponent implements OnInit { export class VideoScene implements OnInit {
id_video:number = -1; id_video:number = -1;
error:string = "" error:string = ""
@ -30,10 +30,10 @@ export class VideoComponent implements OnInit {
name:string = "" name:string = ""
description:string = "" description:string = ""
episode:number = undefined episode:number = undefined
group_id:number = undefined series_id:number = undefined
group_name:string = undefined series_name:string = undefined
saison_id:number = undefined season_id:number = undefined
saison_name:string = undefined season_name:string = undefined
data_id:number = -1 data_id:number = -1
time:number = undefined time:number = undefined
type_id:number = undefined type_id:number = undefined
@ -46,8 +46,8 @@ export class VideoComponent implements OnInit {
private router: Router, private router: Router,
private locate: Location, private locate: Location,
private videoService: VideoService, private videoService: VideoService,
private groupService: GroupService, private seriesService: SeriesService,
private saisonService: SaisonService, private seasonService: SeasonService,
private httpService: HttpWrapperService, private httpService: HttpWrapperService,
private arianeService: ArianeService) { private arianeService: ArianeService) {
@ -55,14 +55,14 @@ export class VideoComponent implements OnInit {
generateName() { generateName() {
this.generated_name = ""; this.generated_name = "";
if (this.group_name != undefined) { if (this.series_name != undefined) {
this.generated_name += this.group_name + "-"; this.generated_name += this.series_name + "-";
} }
if (this.saison_name != undefined) { if (this.season_name != undefined) {
if (this.saison_name.length < 2) { if (this.season_name.length < 2) {
this.generated_name += "s0" + this.saison_name + "-"; this.generated_name += "s0" + this.season_name + "-";
} else { } else {
this.generated_name += "s" + this.saison_name + "-"; this.generated_name += "s" + this.season_name + "-";
} }
} }
if (this.episode != undefined) { if (this.episode != undefined) {
@ -87,8 +87,8 @@ export class VideoComponent implements OnInit {
self.name = response.name; self.name = response.name;
self.description = response.description; self.description = response.description;
self.episode = response.episode; self.episode = response.episode;
self.group_id = response.serie_id; self.series_id = response.series_id;
self.saison_id = response.saison_id; self.season_id = response.season_id;
self.data_id = response.data_id; self.data_id = response.data_id;
self.time = response.time; self.time = response.time;
self.generated_name = response.generated_name; self.generated_name = response.generated_name;
@ -106,19 +106,19 @@ export class VideoComponent implements OnInit {
} }
} }
self.generateName(); self.generateName();
if (self.group_id !== undefined && self.group_id !== null) { if (self.series_id !== undefined && self.series_id !== null) {
self.groupService.get(self.group_id) self.seriesService.get(self.series_id)
.then(function(response) { .then(function(response) {
self.group_name = response.name; self.series_name = response.name;
self.generateName(); self.generateName();
}).catch(function(response) { }).catch(function(response) {
// nothing to do ... // nothing to do ...
}); });
} }
if (self.saison_id !== undefined && self.saison_id !== null) { if (self.season_id !== undefined && self.season_id !== null) {
self.saisonService.get(self.saison_id) self.seasonService.get(self.season_id)
.then(function(response) { .then(function(response) {
self.saison_name = response.name; self.season_name = response.name;
self.generateName(); self.generateName();
}).catch(function(response) { }).catch(function(response) {
// nothing to do ... // nothing to do ...
@ -131,15 +131,15 @@ export class VideoComponent implements OnInit {
self.name = ""; self.name = "";
self.description = ""; self.description = "";
self.episode = undefined; self.episode = undefined;
self.group_id = undefined; self.series_id = undefined;
self.saison_id = undefined; self.season_id = undefined;
self.data_id = -1; self.data_id = -1;
self.time = undefined; self.time = undefined;
self.generated_name = ""; self.generated_name = "";
self.video_source = ""; self.video_source = "";
self.cover = null; self.cover = null;
self.group_name = undefined; self.series_name = undefined;
self.saison_name = undefined; self.season_name = undefined;
}); });
} }

View File

@ -8,18 +8,18 @@ import { Injectable, Output, EventEmitter, OnInit} from '@angular/core'
import { Router, ActivatedRoute, ParamMap, NavigationEnd } from '@angular/router'; import { Router, ActivatedRoute, ParamMap, NavigationEnd } from '@angular/router';
import { TypeService } from 'app/service/type'; import { TypeService } from './type';
import { UniversService } from 'app/service/univers'; import { UniverseService } from './universe';
import { GroupService } from 'app/service/group'; import { SeriesService } from './series';
import { SaisonService } from 'app/service/saison'; import { SeasonService } from './season';
import { VideoService } from 'app/service/video'; import { VideoService } from './video';
import { environment } from 'environments/environment'; import { environment } from '../../environments/environment';
export class InputOrders { export class InputOrders {
public type_id: number = null; public type_id: number = null;
public univers_id: number = null; public universe_id: number = null;
public group_id: number = null; public series_id: number = null;
public saison_id: number = null; public season_id: number = null;
public video_id: number = null; public video_id: number = null;
} }
@ -31,17 +31,17 @@ export class ArianeService {
public type_name: string = null; public type_name: string = null;
@Output() type_change: EventEmitter<number> = new EventEmitter(); @Output() type_change: EventEmitter<number> = new EventEmitter();
public univers_id: number = null; public universe_id: number = null;
public univers_name: string = null; public universe_name: string = null;
@Output() univers_change: EventEmitter<number> = new EventEmitter(); @Output() universe_change: EventEmitter<number> = new EventEmitter();
public group_id: number = null; public series_id: number = null;
public group_name: string = null; public series_name: string = null;
@Output() group_change: EventEmitter<number> = new EventEmitter(); @Output() series_change: EventEmitter<number> = new EventEmitter();
public saison_id: number = null; public season_id: number = null;
public saison_name: string = null; public season_name: string = null;
@Output() saison_change: EventEmitter<number> = new EventEmitter(); @Output() season_change: EventEmitter<number> = new EventEmitter();
public video_id: number = null; public video_id: number = null;
public video_name: string = null; public video_name: string = null;
@ -50,9 +50,9 @@ export class ArianeService {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private typeService: TypeService, private typeService: TypeService,
private universService: UniversService, private universeService: UniverseService,
private groupService: GroupService, private seriesService: SeriesService,
private saisonService: SaisonService, private seasonService: SeasonService,
private videoService: VideoService) { private videoService: VideoService) {
console.log("Start ArianeService"); console.log("Start ArianeService");
} }
@ -75,29 +75,29 @@ export class ArianeService {
} }
console.log("type_id = " + type_id + " " + params.get('type_id')); console.log("type_id = " + type_id + " " + params.get('type_id'));
let univers_id = params.get('univers_id'); let universe_id = params.get('universe_id');
if (univers_id === null || univers_id === undefined || univers_id == "null" || univers_id == "NULL" || univers_id == "") { if (universe_id === null || universe_id === undefined || universe_id == "null" || universe_id == "NULL" || universe_id == "") {
univers_id = null; universe_id = null;
} else { } else {
univers_id = parseInt(univers_id) universe_id = parseInt(universe_id)
} }
console.log("univers_id = " + univers_id + " " + params.get('univers_id')); console.log("universe_id = " + universe_id + " " + params.get('univers_id'));
let group_id = params.get('group_id'); let series_id = params.get('series_id');
if (group_id === null || group_id === undefined || group_id == "null" || group_id == "NULL" || group_id == "") { if (series_id === null || series_id === undefined || series_id == "null" || series_id == "NULL" || series_id == "") {
group_id = null; series_id = null;
} else { } else {
group_id = parseInt(group_id) series_id = parseInt(series_id)
} }
console.log("group_id = " + group_id + " " + params.get('group_id')); console.log("series_id = " + series_id + " " + params.get('series_id'));
let saison_id = params.get('saison_id'); let season_id = params.get('season_id');
if (saison_id === null || saison_id === undefined || saison_id == "null" || saison_id == "NULL" || saison_id == "") { if (season_id === null || season_id === undefined || season_id == "null" || season_id == "NULL" || season_id == "") {
saison_id = null; season_id = null;
} else { } else {
saison_id = parseInt(saison_id) season_id = parseInt(season_id)
} }
console.log("saison_id = " + saison_id + " " + params.get('saison_id')); console.log("season_id = " + season_id + " " + params.get('season_id'));
let video_id = params.get('video_id'); let video_id = params.get('video_id');
if (video_id === null || video_id === undefined || video_id == "null" || video_id == "NULL" || video_id == "") { if (video_id === null || video_id === undefined || video_id == "null" || video_id == "NULL" || video_id == "") {
@ -108,24 +108,24 @@ export class ArianeService {
console.log("video_id = " + video_id + " " + params.get('video_id')); console.log("video_id = " + video_id + " " + params.get('video_id'));
this.setType(type_id); this.setType(type_id);
this.setUnivers(univers_id); this.setUniverse(universe_id);
this.setGroup(group_id); this.setSeries(series_id);
this.setSaison(saison_id); this.setSeason(season_id);
this.setVideo(video_id); this.setVideo(video_id);
} }
reset():void { reset():void {
this.type_id = null; this.type_id = null;
this.type_name = null; this.type_name = null;
this.type_change.emit(this.type_id); this.type_change.emit(this.type_id);
this.univers_id = null; this.universe_id = null;
this.univers_name = null; this.universe_name = null;
this.univers_change.emit(this.univers_id); this.universe_change.emit(this.universe_id);
this.group_id = null; this.series_id = null;
this.group_name = null; this.series_name = null;
this.group_change.emit(this.group_id); this.series_change.emit(this.series_id);
this.saison_id = null; this.season_id = null;
this.saison_name = null; this.season_name = null;
this.saison_change.emit(this.saison_id); this.season_change.emit(this.season_id);
this.video_id = null; this.video_id = null;
this.video_name = null; this.video_name = null;
this.video_change.emit(this.video_id); this.video_change.emit(this.video_id);
@ -137,17 +137,17 @@ export class ArianeService {
if (out.type_id == 0){ if (out.type_id == 0){
out.type_id = undefined; out.type_id = undefined;
} }
out.univers_id = parseInt(this.route.snapshot.paramMap.get('univers_id')); out.universe_id = parseInt(this.route.snapshot.paramMap.get('univers_id'));
if (out.univers_id == 0){ if (out.universe_id == 0){
out.univers_id = undefined; out.universe_id = undefined;
} }
out.group_id = parseInt(this.route.snapshot.paramMap.get('group_id')); out.series_id = parseInt(this.route.snapshot.paramMap.get('series_id'));
if (out.group_id == 0){ if (out.series_id == 0){
out.group_id = undefined; out.series_id = undefined;
} }
out.saison_id = parseInt(this.route.snapshot.paramMap.get('saison_id')); out.season_id = parseInt(this.route.snapshot.paramMap.get('season_id'));
if (out.saison_id == 0){ if (out.season_id == 0){
out.saison_id = undefined; out.season_id = undefined;
} }
out.video_id = parseInt(this.route.snapshot.paramMap.get('video_id')); out.video_id = parseInt(this.route.snapshot.paramMap.get('video_id'));
if (out.video_id == 0){ if (out.video_id == 0){
@ -159,7 +159,7 @@ export class ArianeService {
routeTo(_data:InputOrders, _destination:string = null) { routeTo(_data:InputOrders, _destination:string = null) {
routeTo = "" routeTo = ""
//if ( //if (
this.router.navigate(['/type/' + this.type_id + '/group/' + this.id_group + '/saison/' + _idSelected ]); this.router.navigate(['/type/' + this.type_id + '/series/' + this.id_series + '/season/' + _idSelected ]);
} }
*/ */
@ -192,92 +192,92 @@ export class ArianeService {
return this.type_name; return this.type_name;
} }
setUnivers(_id:number) { setUniverse(_id:number) {
if (this.univers_id == _id) { if (this.universe_id == _id) {
return; return;
} }
if (_id === undefined) { if (_id === undefined) {
return; return;
} }
this.univers_id = _id; this.universe_id = _id;
this.univers_name = "??--??"; this.universe_name = "??--??";
if (this.univers_id === null) { if (this.universe_id === null) {
this.univers_change.emit(this.univers_id); this.universe_change.emit(this.universe_id);
return; return;
} }
let self = this; let self = this;
this.universService.get(_id) this.universeService.get(_id)
.then(function(response) { .then(function(response) {
self.univers_name = response.number self.universe_name = response.number
self.univers_change.emit(self.univers_id); self.universe_change.emit(self.universe_id);
}).catch(function(response) { }).catch(function(response) {
self.univers_change.emit(self.univers_id); self.universe_change.emit(self.universe_id);
}); });
} }
getUniversId():number { getUniverseId():number {
return this.univers_id; return this.universe_id;
} }
getUniversName():string { getUniverseName():string {
return this.univers_name; return this.universe_name;
} }
setGroup(_id:number):void { setSeries(_id:number):void {
if (this.group_id == _id) { if (this.series_id == _id) {
return; return;
} }
if (_id === undefined) { if (_id === undefined) {
return; return;
} }
this.group_id = _id; this.series_id = _id;
this.group_name = "??--??"; this.series_name = "??--??";
if (this.group_id === null) { if (this.series_id === null) {
this.group_change.emit(this.group_id); this.series_change.emit(this.series_id);
return; return;
} }
let self = this; let self = this;
this.groupService.get(_id) this.seriesService.get(_id)
.then(function(response) { .then(function(response) {
self.group_name = response.name self.series_name = response.name
self.group_change.emit(self.group_id); self.series_change.emit(self.series_id);
}).catch(function(response) { }).catch(function(response) {
self.group_change.emit(self.group_id); self.series_change.emit(self.series_id);
}); });
} }
getGroupId():number { getSeriesId():number {
return this.group_id; return this.series_id;
} }
getGroupName():string { getSeriesName():string {
return this.group_name; return this.series_name;
} }
setSaison(_id:number):void { setSeason(_id:number):void {
if (this.saison_id == _id) { if (this.season_id == _id) {
return; return;
} }
if (_id === undefined) { if (_id === undefined) {
return; return;
} }
this.saison_id = _id; this.season_id = _id;
this.saison_name = "??--??"; this.season_name = "??--??";
if (this.saison_id === null) { if (this.season_id === null) {
this.saison_change.emit(this.saison_id); this.season_change.emit(this.season_id);
return; return;
} }
let self = this; let self = this;
this.saisonService.get(_id) this.seasonService.get(_id)
.then(function(response) { .then(function(response) {
//self.setGroup(response.group_id); //self.setSeries(response.series_id);
self.saison_name = response.name self.season_name = response.name
self.saison_change.emit(self.saison_id); self.season_change.emit(self.season_id);
}).catch(function(response) { }).catch(function(response) {
self.saison_change.emit(self.saison_id); self.season_change.emit(self.season_id);
}); });
} }
getSaisonId():number { getSeasonId():number {
return this.saison_id; return this.season_id;
} }
getSaisonName():string { getSeasonName():string {
return this.saison_name; return this.season_name;
} }
setVideo(_id:number):void { setVideo(_id:number):void {
@ -296,8 +296,8 @@ export class ArianeService {
let self = this; let self = this;
this.videoService.get(_id) this.videoService.get(_id)
.then(function(response) { .then(function(response) {
//self.setSaison(response.saison_id); //self.setSeason(response.season_id);
//self.setGroup(response.group_id); //self.setSeries(response.series_id);
self.video_name = response.name; self.video_name = response.name;
self.video_change.emit(self.video_id); self.video_change.emit(self.video_id);
}).catch(function(response) { }).catch(function(response) {
@ -311,8 +311,8 @@ export class ArianeService {
return this.video_name; return this.video_name;
} }
genericNavigate(_destination:string, _universId:number, _typeId:number, _groupId:number, _saisonId:number, _videoId:number, _newWindows:boolean):void { genericNavigate(_destination:string, _universeId:number, _typeId:number, _seriesId:number, _seasonId:number, _videoId:number, _newWindows:boolean):void {
let addressOffset = _destination + '/' + _universId + '/' + _typeId + '/' + _groupId + '/' + _saisonId + '/' + _videoId; let addressOffset = _destination + '/' + _universeId + '/' + _typeId + '/' + _seriesId + '/' + _seasonId + '/' + _videoId;
if(_newWindows==true) { if(_newWindows==true) {
if (environment.frontBaseUrl === undefined || environment.frontBaseUrl === null || environment.frontBaseUrl === "") { if (environment.frontBaseUrl === undefined || environment.frontBaseUrl === null || environment.frontBaseUrl === "") {
window.open('/' + addressOffset); window.open('/' + addressOffset);
@ -324,35 +324,35 @@ export class ArianeService {
} }
} }
navigateUnivers(_id:number, _newWindows:boolean):void { navigateUniverse(_id:number, _newWindows:boolean):void {
this.genericNavigate('univers', _id, this.type_id, null, null, null, _newWindows); this.genericNavigate('universe', _id, this.type_id, null, null, null, _newWindows);
} }
navigateUniversEdit(_id:number, _newWindows:boolean):void { navigateUniverseEdit(_id:number, _newWindows:boolean):void {
this.genericNavigate('univers-edit', _id, this.type_id, null, null, null, _newWindows); this.genericNavigate('universe-edit', _id, this.type_id, null, null, null, _newWindows);
} }
navigateType(_id:number, _newWindows:boolean):void { navigateType(_id:number, _newWindows:boolean):void {
this.genericNavigate('type', this.univers_id, _id, null, null, null, _newWindows); this.genericNavigate('type', this.universe_id, _id, null, null, null, _newWindows);
} }
navigateTypeEdit(_id:number, _newWindows:boolean):void { navigateTypeEdit(_id:number, _newWindows:boolean):void {
this.genericNavigate('type-edit', this.univers_id, _id, null, null, null, _newWindows); this.genericNavigate('type-edit', this.universe_id, _id, null, null, null, _newWindows);
} }
navigateGroup(_id:number, _newWindows:boolean):void { navigateSeries(_id:number, _newWindows:boolean):void {
this.genericNavigate('group', this.univers_id, this.type_id, _id, null, null, _newWindows); this.genericNavigate('series', this.universe_id, this.type_id, _id, null, null, _newWindows);
} }
navigateGroupEdit(_id:number, _newWindows:boolean):void { navigateSeriesEdit(_id:number, _newWindows:boolean):void {
this.genericNavigate('group-edit', this.univers_id, this.type_id, _id, null, null, _newWindows); this.genericNavigate('series-edit', this.universe_id, this.type_id, _id, null, null, _newWindows);
} }
navigateSaison(_id:number, _newWindows:boolean):void { navigateSeason(_id:number, _newWindows:boolean):void {
this.genericNavigate('saison', this.univers_id, this.type_id, this.group_id, _id, null, _newWindows); this.genericNavigate('season', this.universe_id, this.type_id, this.series_id, _id, null, _newWindows);
} }
navigateSaisonEdit(_id:number, _newWindows:boolean):void { navigateSeasonEdit(_id:number, _newWindows:boolean):void {
this.genericNavigate('saison-edit', this.univers_id, this.type_id, this.group_id, _id, null, _newWindows); this.genericNavigate('season-edit', this.universe_id, this.type_id, this.series_id, _id, null, _newWindows);
} }
navigateVideo(_id:number, _newWindows:boolean):void { navigateVideo(_id:number, _newWindows:boolean):void {
this.genericNavigate('video', this.univers_id, this.type_id, this.group_id, this.saison_id, _id, _newWindows); this.genericNavigate('video', this.universe_id, this.type_id, this.series_id, this.season_id, _id, _newWindows);
} }
navigateVideoEdit(_id:number, _newWindows:boolean):void { navigateVideoEdit(_id:number, _newWindows:boolean):void {
this.genericNavigate('video-edit', this.univers_id, this.type_id, this.group_id, this.saison_id, _id, _newWindows); this.genericNavigate('video-edit', this.universe_id, this.type_id, this.series_id, this.season_id, _id, _newWindows);
} }

View File

@ -1,23 +1,22 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
import { DataInterface } from 'app/service/dataInterface'; import { DataInterface } from './dataInterface';
import { environment } from 'environments/environment';
@Injectable() @Injectable()
export class BddService { export class BddService {
private bdd = { private bdd = {
"type": null, "type": null,
"group": null, "series": null,
"saison": null, "season": null,
"univers": null, "universe": null,
"video": null "video": null
}; };
private bddPomise = { private bddPomise = {
"type": null, "type": null,
"group": null, "series": null,
"saison": null, "season": null,
"univers": null, "universe": null,
"video": null "video": null
}; };
@ -30,9 +29,10 @@ export class BddService {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.get(_name) self.get(_name)
.then(function(response) { .then(function(response:DataInterface) {
let responseTmp = response;
ret.then(function(response2) { ret.then(function(response2) {
response.set(_id, response2); responseTmp.set(_id, response2);
resolve(response2); resolve(response2);
}).catch(function(response2) { }).catch(function(response2) {
reject(response2); reject(response2);
@ -42,14 +42,24 @@ export class BddService {
}); });
}); });
} }
asyncSetInDB(_name: string, _id: number, data: any) {
let self = this;
self.get(_name)
.then(function(response:DataInterface) {
response.set(_id, data);
}).catch(function(response) {
// nothing to do ...
});
}
delete(_name: string, _id: number, ret: any) { delete(_name: string, _id: number, ret: any) {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.get(_name) self.get(_name)
.then(function(response) { .then(function(response:DataInterface) {
let responseTmp = response;
ret.then(function(response2) { ret.then(function(response2) {
response.delete(_id); responseTmp.delete(_id);
resolve(response2); resolve(response2);
}).catch(function(response2) { }).catch(function(response2) {
reject(response2); reject(response2);
@ -62,8 +72,9 @@ export class BddService {
get(_name: string): any { get(_name: string): any {
let self = this; let self = this;
console.log("Try to get DB '" + _name + "'");
if (this.bdd[_name] === undefined) { if (this.bdd[_name] === undefined) {
console.log("Try to get a non existant BDD ... '" + _name + "'"); console.log("Try to get a non existant DB ... '" + _name + "'");
return; return;
} }
if (this.bdd[_name] !== null) { if (this.bdd[_name] !== null) {
@ -101,24 +112,24 @@ export class BddService {
}); });
} }
getType():any { getType():DataInterface {
return this.get("type"); return this.get("type");
}; }
getGroup():any { getSeries():DataInterface {
return this.get("group"); return this.get("series");
}; }
getSaison():any { getSeason():DataInterface {
return this.get("saison"); return this.get("season");
}; }
getUnivers():any { getUniverse():DataInterface {
return this.get("univers"); return this.get("universe");
}; }
getVideo():any { getVideo():DataInterface {
return this.get("video"); return this.get("video");
}; }
} }

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
import { DataInterface } from 'app/service/dataInterface'; import { DataInterface } from './dataInterface';
import { environment } from 'environments/environment';
@Injectable() @Injectable()
export class DataService { export class DataService {

View File

@ -248,13 +248,21 @@ export class DataInterface {
} }
//console.log("order in list by : " + value_order); //console.log("order in list by : " + value_order);
//out = sorted(out, key=lambda x{ x[value_order]) //out = sorted(out, key=lambda x{ x[value_order])
out.sort(function (a, b) { if (value_order == "name") {
//const name1 = t1.name.toLowerCase(); out.sort(function (a, b) {
//const name2 = t2.name.toLowerCase(); const name1 = a[value_order].toLowerCase();
const name2 = b[value_order].toLowerCase();
if (name1 > name2) { return 1; }
if (name1 < name2) { return -1; }
return 0;
});
} else {
out.sort(function (a, b) {
if (a[value_order] > b[value_order]) { return 1; } if (a[value_order] > b[value_order]) { return 1; }
if (a[value_order] < b[value_order]) { return -1; } if (a[value_order] < b[value_order]) { return -1; }
return 0; return 0;
}); });
}
if (_order.length > 1) { if (_order.length > 1) {
out_unclassable = this.order_by(out_unclassable, _order.slice(1)); out_unclassable = this.order_by(out_unclassable, _order.slice(1));
} }

View File

@ -4,7 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams, HttpRequest, HttpEvent} from '@ang
import { catchError, map, tap } from 'rxjs/operators'; import { catchError, map, tap } from 'rxjs/operators';
import {Observable} from "rxjs"; import {Observable} from "rxjs";
import { environment } from 'environments/environment'; import { environment } from '../../environments/environment';
@Injectable() @Injectable()
export class HttpOAuthWrapperService { export class HttpOAuthWrapperService {
@ -312,7 +312,7 @@ export class HttpOAuthWrapperService {
} }
}); });
}); });
}; }
// Complex wrapper to simplify interaction: // Complex wrapper to simplify interaction:
delete_specific(_base:string, _id:number, _subElement:string = ""):any { delete_specific(_base:string, _id:number, _subElement:string = ""):any {
@ -349,7 +349,7 @@ export class HttpOAuthWrapperService {
} }
}); });
}); });
}; }
// Complex wrapper to simplify interaction: // Complex wrapper to simplify interaction:
put_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any { put_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
//console.log("put data to " + _base); //console.log("put data to " + _base);
@ -385,7 +385,7 @@ export class HttpOAuthWrapperService {
} }
}); });
}); });
}; }
// Complex wrapper to simplify interaction: // Complex wrapper to simplify interaction:
post_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any { post_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
//console.log("put data to " + _base); //console.log("put data to " + _base);
@ -421,5 +421,5 @@ export class HttpOAuthWrapperService {
} }
}); });
}); });
}; }
} }

View File

@ -4,8 +4,8 @@ import { HttpClient, HttpHeaders, HttpParams, HttpRequest, HttpEvent, HttpEventT
import { catchError, map, tap } from 'rxjs/operators'; import { catchError, map, tap } from 'rxjs/operators';
import {Observable} from "rxjs"; import {Observable} from "rxjs";
import { environment } from 'environments/environment'; import { environment } from '../../environments/environment';
import { SessionService } from 'app/service/session'; import { SessionService } from './session';
@Injectable() @Injectable()
export class HttpWrapperService { export class HttpWrapperService {
@ -404,8 +404,8 @@ export class HttpWrapperService {
self.post(url, headers, _multipart, _progress) self.post(url, headers, _multipart, _progress)
.then(function(response: any) { .then(function(response: any) {
console.log("URL: " + url + "\nRespond(" + response.status + "): " + JSON.stringify(response.data, null, 2)); console.log("URL: " + url + "\nRespond(" + response.status + "): " + JSON.stringify(response.data, null, 2));
if (response.status == 200) { if (response.status >= 200 && response.status <= 299) {
resolve(response.data); resolve(response.data.body);
return; return;
} }
reject("An error occured"); reject("An error occured");
@ -484,7 +484,7 @@ export class HttpWrapperService {
} }
}); });
}); });
}; }
// Complex wrapper to simplify interaction: // Complex wrapper to simplify interaction:
delete_specific(_base:string, _id:number, _subElement:string = ""):any { delete_specific(_base:string, _id:number, _subElement:string = ""):any {
@ -521,7 +521,7 @@ export class HttpWrapperService {
} }
}); });
}); });
}; }
// Complex wrapper to simplify interaction: // Complex wrapper to simplify interaction:
put_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any { put_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
//console.log("put data to " + _base); //console.log("put data to " + _base);
@ -557,7 +557,7 @@ export class HttpWrapperService {
} }
}); });
}); });
}; }
// Complex wrapper to simplify interaction: // Complex wrapper to simplify interaction:
post_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any { post_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
//console.log("put data to " + _base); //console.log("put data to " + _base);
@ -593,5 +593,5 @@ export class HttpWrapperService {
} }
}); });
}); });
}; }
} }

View File

@ -1,25 +1,24 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
import { DataInterface } from 'app/service/dataInterface'; import { DataInterface } from './dataInterface';
import { environment } from 'environments/environment'; import { BddService } from './bdd';
import { BddService } from 'app/service/bdd';
@Injectable() @Injectable()
export class SaisonService { export class SeasonService {
// 0: Not hide password; 1 hide password; // 0: Not hide password; 1 hide password;
private identificationVersion: number = 1; private identificationVersion: number = 1;
private serviceName:string = "saison"; private serviceName:string = "season";
constructor(private http: HttpWrapperService, constructor(private http: HttpWrapperService,
private bdd: BddService) { private bdd: BddService) {
console.log("Start SaisonService"); console.log("Start SeasonService");
} }
get(_id:number):any { get(_id:number):any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getSaison() self.bdd.getSeason()
.then(function(response) { .then(function(response) {
let data = response.get(_id); let data = response.get(_id);
if (data === null || data === undefined) { if (data === null || data === undefined) {
@ -37,8 +36,8 @@ export class SaisonService {
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([["==", "saison_id", _id]], ["id", "name", "episode"], ["episode", "name"]) //let data = response.gets_where([["==", "season_id", _id]], ["id", "name", "episode"], ["episode", "name"])
let data = response.gets_where([["==", "saison_id", _id]], undefined, ["episode", "name"]) let data = response.gets_where([["==", "season_id", _id]], undefined, ["episode", "name"])
resolve(data); resolve(data);
}).catch(function(response) { }).catch(function(response) {
reject(response); reject(response);
@ -50,8 +49,8 @@ export class SaisonService {
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([["==", "saison_id", _id]], ["id", "name", "episode"], ["episode", "name"]) //let data = response.gets_where([["==", "season_id", _id]], ["id", "name", "episode"], ["episode", "name"])
let data = response.gets_where([["==", "saison_id", _id]], undefined, ["episode", "name"]) let data = response.gets_where([["==", "season_id", _id]], undefined, ["episode", "name"])
resolve(data.length); resolve(data.length);
}).catch(function(response) { }).catch(function(response) {
reject(response); reject(response);

View File

@ -1,25 +1,24 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
import { DataInterface } from 'app/service/dataInterface'; import { DataInterface } from './dataInterface';
import { BddService } from 'app/service/bdd'; import { BddService } from './bdd';
import { environment } from 'environments/environment';
@Injectable() @Injectable()
export class GroupService { export class SeriesService {
// 0: Not hide password; 1 hide password; // 0: Not hide password; 1 hide password;
private identificationVersion: number = 1; private identificationVersion: number = 1;
private serviceName:string = "group"; private serviceName:string = "series";
constructor(private http: HttpWrapperService, constructor(private http: HttpWrapperService,
private bdd: BddService) { private bdd: BddService) {
console.log("Start GroupService"); console.log("Start SeriesService");
} }
get(_id:number):any { get(_id:number):any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getGroup() self.bdd.getSeries()
.then(function(response) { .then(function(response) {
let data = response.get(_id); let data = response.get(_id);
if (data === null || data === undefined) { if (data === null || data === undefined) {
@ -32,12 +31,12 @@ export class GroupService {
reject(response); reject(response);
}); });
}); });
}; }
getData():any { getData():any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getGroup() self.bdd.getSeries()
.then(function(response) { .then(function(response) {
let data = response.gets(); let data = response.gets();
resolve(data); resolve(data);
@ -46,12 +45,12 @@ export class GroupService {
reject(response); reject(response);
}); });
}); });
}; }
getOrder():any { getOrder():any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getGroup() self.bdd.getSeries()
.then(function(response) { .then(function(response) {
let data = response.gets_where([["!=", "id", null]], ["id", "name"], ["name","id"]) let data = response.gets_where([["!=", "id", null]], ["id", "name"], ["name","id"])
resolve(data); resolve(data);
@ -60,30 +59,30 @@ export class GroupService {
reject(response); reject(response);
}); });
}); });
}; }
getVideoAll(_id:number):any { getVideoAll(_id:number):any {
//this.checkLocalBdd(); //this.checkLocalBdd();
}; }
getVideo(_id:number):any { getVideo(_id:number):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([["==", "serie_id", _id], ["==", "saison_id", null]], ["id"], ["episode", "name"]) //let data = response.gets_where([["==", "series_id", _id], ["==", "season_id", null]], ["id"], ["episode", "name"])
let data = response.gets_where([["==", "serie_id", _id], ["==", "saison_id", null]], undefined, ["episode", "name"]) let data = response.gets_where([["==", "series_id", _id], ["==", "season_id", null]], undefined, ["episode", "name"])
resolve(data); resolve(data);
}).catch(function(response) { }).catch(function(response) {
reject(response); reject(response);
}); });
}); });
}; }
getSaison(_id:number, _select:Array<string> = []):any { getSeason(_id:number, _select:Array<string> = []):any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getSaison() self.bdd.getSeason()
.then(function(response) { .then(function(response) {
let data = response.gets_where([["==", "parent_id", _id]], ["id"], ["number"]) let data = response.gets_where([["==", "parent_id", _id]], ["id"], ["number"])
if (_select.length == 0) { if (_select.length == 0) {
@ -102,30 +101,31 @@ export class GroupService {
reject(response); reject(response);
}); });
}); });
}; }
put(_id:number, _data:any):any { put(_id:number, _data:any):any {
let ret = this.http.put_specific(this.serviceName, _id, _data); let ret = this.http.put_specific(this.serviceName, _id, _data);
return this.bdd.setAfterPut(this.serviceName, _id, ret); return this.bdd.setAfterPut(this.serviceName, _id, ret);
}; }
addCover(_id:number, _coverId:number):any { addCover(_id:number, _coverId:number):any {
return this.http.post_specific(this.serviceName, _id, {"data_id":_coverId}, "add_cover"); return this.http.post_specific(this.serviceName, _id, {"data_id":_coverId}, "add_cover");
}; }
getCoverUrl(_coverId:number):any { getCoverUrl(_coverId:number):any {
return this.http.createRESTCall("data/" + _coverId); return this.http.createRESTCall("data/" + _coverId);
}; }
getCoverThumbnailUrl(_coverId:number):any { getCoverThumbnailUrl(_coverId:number):any {
return this.http.createRESTCall("data/thumbnail/" + _coverId); return this.http.createRESTCall("data/thumbnail/" + _coverId);
}; }
getLike(_nameGroup:string):any { getLike(_nameSeries:string):any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getGroup() self.bdd.getSeries()
.then(function(response) { .then(function(response) {
let data = response.getNameLike(_nameGroup); let data = response.getNameLike(_nameSeries);
if (data === null || data === undefined) { if (data === null || data === undefined) {
reject("Data does not exist in the local BDD"); reject("Data does not exist in the local BDD");
return; return;

View File

@ -1,11 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
//import { SHA512 } from 'assets/js_3rd_party/sha512'; import { DataInterface } from './dataInterface';
import { DataInterface } from 'app/service/dataInterface'; import { BddService } from './bdd';
import { BddService } from 'app/service/bdd';
import { environment } from 'environments/environment';
export interface MessageLogIn { export interface MessageLogIn {
id: number; id: number;
@ -66,16 +64,16 @@ export class TypeService {
self.bdd.getVideo() self.bdd.getVideo()
.then(function(response) { .then(function(response) {
if (_select.length == 0) { if (_select.length == 0) {
let data = response.gets_where([["==", "type_id", _id], ["==", "serie_id", null], ["==", "univers_id", null]], undefined, ["name"]); let data = response.gets_where([["==", "type_id", _id], ["==", "series_id", null], ["==", "universe_id", null]], undefined, ["name"]);
resolve(data); resolve(data);
return; return;
} }
if (_select[0] == "*") { if (_select[0] == "*") {
let data = response.gets_where([["==", "type_id", _id], ["==", "serie_id", null], ["==", "univers_id", null]], undefined, ["name"]); let data = response.gets_where([["==", "type_id", _id], ["==", "series_id", null], ["==", "universe_id", null]], undefined, ["name"]);
resolve(data); resolve(data);
return; return;
} }
let data = response.gets_where([["==", "type_id", _id], ["==", "serie_id", null], ["==", "univers_id", null]], _select, ["name"]); let data = response.gets_where([["==", "type_id", _id], ["==", "series_id", null], ["==", "universe_id", null]], _select, ["name"]);
resolve(data); resolve(data);
return; return;
}).catch(function(response) { }).catch(function(response) {
@ -84,17 +82,17 @@ export class TypeService {
}); });
} }
getSubGroup(_id:number, _select:Array<string> = []):any { getSubSeries(_id:number, _select:Array<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([["==", "type_id", _id], ["!=", "serie_id", null], ["==", "univers_id", null]], ["serie_id"], ["name"]); let data = response.gets_where([["==", "type_id", _id], ["!=", "series_id", null], ["==", "universe_id", null]], ["series_id"], ["name"]);
if (_select.length == 0) { if (_select.length == 0) {
resolve(data); resolve(data);
return; return;
} }
self.bdd.getGroup() 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.gets_where([["==", "id", data]], undefined, ["name"]);
@ -113,17 +111,17 @@ export class TypeService {
}); });
} }
getSubUnivers(_id:number, _select:Array<string> = []):any { getSubUniverse(_id:number, _select:Array<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.data.gets_where([["==", "type_id", _id], ["==", "serie_id", null], ["==", "univers_id", null]], ["univers_id"], ["name"]); let data = response.data.gets_where([["==", "type_id", _id], ["==", "series_id", null], ["==", "universe_id", null]], ["univers_id"], ["name"]);
if (_select.length == 0) { if (_select.length == 0) {
resolve(data); resolve(data);
return; return;
} }
self.bdd.getUnivers() self.bdd.getUniverse()
.then(function(response2) { .then(function(response2) {
if (_select[0] == "*") { if (_select[0] == "*") {
let data2 = response2.gets_where([["==", "id", data]], undefined, ["name"]); let data2 = response2.gets_where([["==", "id", data]], undefined, ["name"]);

View File

@ -1,25 +1,23 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
import { DataInterface } from 'app/service/dataInterface'; import { DataInterface } from './dataInterface';
import { BddService } from 'app/service/bdd'; import { BddService } from './bdd';
import { environment } from 'environments/environment';
@Injectable() @Injectable()
export class UniversService { export class UniverseService {
// 0: Not hide password; 1 hide password; // 0: Not hide password; 1 hide password;
private identificationVersion: number = 1; private identificationVersion: number = 1;
private serviceName:string = "univers"; private serviceName:string = "universe";
constructor(private http: HttpWrapperService, constructor(private http: HttpWrapperService,
private bdd: BddService) { private bdd: BddService) {
console.log("Start universService"); console.log("Start universeService");
} }
getData():any { getData():any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getUnivers() self.bdd.getUniverse()
.then(function(response) { .then(function(response) {
let data = response.gets(); let data = response.gets();
resolve(data); resolve(data);
@ -27,12 +25,12 @@ export class UniversService {
reject(response); reject(response);
}); });
}); });
}; }
get(_id:number):any { get(_id:number):any {
let self = this; let self = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
self.bdd.getUnivers() self.bdd.getUniverse()
.then(function(response) { .then(function(response) {
let data = response.get(_id); let data = response.get(_id);
if (data === null || data === undefined) { if (data === null || data === undefined) {
@ -44,25 +42,25 @@ export class UniversService {
reject(response); reject(response);
}); });
}); });
}; }
getSubGroup(_id:number, _select:Array<string> = []):any { getSubSeries(_id:number, _select:Array<string> = []):any {
//this.checkLocalBdd(); //this.checkLocalBdd();
}; }
getSubVideo(_id:number, _select:Array<string> = []):any { getSubVideo(_id:number, _select:Array<string> = []):any {
//this.checkLocalBdd(); //this.checkLocalBdd();
}; }
put(_id:number, _data:any):any { put(_id:number, _data:any):any {
let ret = this.http.put_specific(this.serviceName, _id, _data); let ret = this.http.put_specific(this.serviceName, _id, _data);
return this.bdd.setAfterPut(this.serviceName, _id, ret); return this.bdd.setAfterPut(this.serviceName, _id, ret);
}; }
addCover(_id:number, _coverId:number):any { addCover(_id:number, _coverId:number):any {
return this.http.post_specific(this.serviceName, _id, {"data_id":_coverId}, "add_cover"); return this.http.post_specific(this.serviceName, _id, {"data_id":_coverId}, "add_cover");
}; }
getCoverUrl(_coverId:number):any { getCoverUrl(_coverId:number):any {
return this.http.createRESTCall("data/" + _coverId); return this.http.createRESTCall("data/" + _coverId);
}; }
} }

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpOAuthWrapperService } from 'app/service/http-oauth-wrapper'; import { HttpOAuthWrapperService } from './http-oauth-wrapper';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
//import { SHA512 } from 'assets/js_3rd_party/sha512'; //import { SHA512 } from 'assets/js_3rd_party/sha512';
interface MessageLogIn { interface MessageLogIn {

View File

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpWrapperService } from 'app/service/http-wrapper'; import { HttpWrapperService } from './http-wrapper';
import { DataInterface } from 'app/service/dataInterface'; import { DataInterface } from './dataInterface';
import { BddService } from 'app/service/bdd'; import { BddService } from './bdd';
import { environment } from 'environments/environment'; import { environment } from '../../environments/environment';
@Injectable() @Injectable()
export class VideoService { export class VideoService {
@ -42,9 +42,6 @@ export class VideoService {
let ret = this.http.delete_specific(this.serviceName, _id); let ret = this.http.delete_specific(this.serviceName, _id);
return this.bdd.delete(this.serviceName, _id, ret); return this.bdd.delete(this.serviceName, _id, ret);
} }
addCover(_id:number, _coverId:number):any {
return this.http.post_specific(this.serviceName, _id, {"data_id":_coverId}, "add_cover");
}
getCoverUrl(_coverId:number):any { getCoverUrl(_coverId:number):any {
return this.http.createRESTCall("data/" + _coverId); return this.http.createRESTCall("data/" + _coverId);
} }
@ -54,8 +51,8 @@ export class VideoService {
uploadFile(_file:File, uploadFile(_file:File,
_universe:string, _universe:string,
_serie:string, _series:string,
_saison:number, _season:number,
_episode:number, _episode:number,
_title:string, _title:string,
_type_id:number, _type_id:number,
@ -63,11 +60,11 @@ export class VideoService {
const formData = new FormData(); const formData = new FormData();
formData.append('file_name', _file.name); formData.append('file_name', _file.name);
formData.append('universe', _universe); formData.append('universe', _universe);
formData.append('serie', _serie); formData.append('series', _series);
if (_saison != null) { if (_season != null) {
formData.append('saison', _saison.toString()); formData.append('season', _season.toString());
} else { } else {
formData.append('saison', null); formData.append('season', null);
} }
if (_episode != null) { if (_episode != null) {
@ -85,5 +82,48 @@ export class VideoService {
formData.append('file', _file); formData.append('file', _file);
return this.http.uploadMultipart(this.serviceName + "/upload/", formData, _progress); return this.http.uploadMultipart(this.serviceName + "/upload/", formData, _progress);
} }
deleteCover(_media_id:number,
_cover_id:number) {
let self = this;
return new Promise((resolve, reject) => {
self.http.get_specific(this.serviceName + "/" + _media_id + "/rm_cover" , _cover_id)
.then(function(response) {
let data = response;
if (data === null || data === undefined) {
reject("error retrive data from server");
return;
}
self.bdd.asyncSetInDB(self.serviceName, _media_id, data);
resolve(data);
}).catch(function(response) {
reject(response);
});
});
}
uploadCover(_file:File,
_media_id:number,
_progress:any = null) {
const formData = new FormData();
formData.append('file_name', _file.name);
formData.append('type_id', _media_id.toString());
formData.append('file', _file);
let self = this;
return new Promise((resolve, reject) => {
self.http.uploadMultipart(this.serviceName + "/" + _media_id + "/add_cover/", formData, _progress)
.then(function(response) {
let data = response;
if (data === null || data === undefined) {
reject("error retrive data from server");
return;
}
self.bdd.asyncSetInDB(self.serviceName, _media_id, data);
resolve(data);
}).catch(function(response) {
reject(response);
});
});
}
} }