[DEV] global naming refacto and set back ad/remove cove of media and edit media properties
This commit is contained in:
parent
5f562ad260
commit
768105f1e9
@ -7,19 +7,19 @@ import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router'; // CLI imports router
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
|
||||
import { HomeComponent } from './scene/home/home';
|
||||
import { TypeComponent } from './scene/type/type';
|
||||
import { UniversComponent } from './scene/univers/univers';
|
||||
import { GroupComponent } from './scene/group/group';
|
||||
import { SaisonComponent } from './scene/saison/saison';
|
||||
import { VideoComponent } from './scene/video/video';
|
||||
import { LoginComponent } from './scene/login/login';
|
||||
import { SignUpComponent } from './scene/sign-up/sign-up';
|
||||
import { SettingsComponent } from './scene/settings/settings';
|
||||
import { HomeScene } from './scene/home/home';
|
||||
import { TypeScene } from './scene/type/type';
|
||||
import { UniverseScene } from './scene/universe/universe';
|
||||
import { SeriesScene } from './scene/series/series';
|
||||
import { SeasonScene } from './scene/season/season';
|
||||
import { VideoScene } from './scene/video/video';
|
||||
import { LoginScene } from './scene/login/login';
|
||||
import { SignUpScene } from './scene/sign-up/sign-up';
|
||||
import { SettingsScene } from './scene/settings/settings';
|
||||
import { UploadScene } from './scene/upload/upload';
|
||||
import { VideoEditComponent } from './scene/video-edit/video-edit';
|
||||
import { GroupEditComponent } from './scene/group-edit/group-edit';
|
||||
import { SaisonEditComponent } from './scene/saison-edit/saison-edit';
|
||||
import { VideoEditScene } from './scene/video-edit/video-edit';
|
||||
import { SeriesEditScene } from './scene/series-edit/series-edit';
|
||||
import { SeasonEditScene } from './scene/season-edit/season-edit';
|
||||
//import { HelpComponent } from './help/help.component';
|
||||
|
||||
// see https://angular.io/guide/router
|
||||
@ -27,24 +27,24 @@ import { SaisonEditComponent } from './scene/saison-edit/saison-edit';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: '/home', pathMatch: 'full'},
|
||||
{ path: 'home', component: HomeComponent },
|
||||
{ path: 'home', component: HomeScene },
|
||||
{ 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: 'group-edit/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: GroupEditComponent },
|
||||
{ path: 'series/:universe_id/:type_id/:series_id/:season_id/:video_id', component: SeriesScene },
|
||||
{ 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: 'saison-edit/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: SaisonEditComponent },
|
||||
{ path: 'season/:universe_id/:type_id/:series_id/:season_id/:video_id', component: SeasonScene },
|
||||
{ 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-edit/:univers_id/:type_id/:group_id/:saison_id/:video_id', component: VideoEditComponent },
|
||||
{ path: 'video/:universe_id/:type_id/:series_id/:season_id/:video_id', component: VideoScene },
|
||||
{ path: 'video-edit/:universe_id/:type_id/:series_id/:season_id/:video_id', component: VideoEditScene },
|
||||
|
||||
{ path: 'login', component: LoginComponent },
|
||||
{ path: 'signup', component: SignUpComponent },
|
||||
{ path: 'settings', component: SettingsComponent },
|
||||
{ path: 'login', component: LoginScene },
|
||||
{ path: 'signup', component: SignUpScene },
|
||||
{ path: 'settings', component: SettingsScene },
|
||||
/*{ path: 'help', component: HelpComponent }*/
|
||||
];
|
||||
/*
|
||||
|
@ -21,30 +21,30 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { UploadFileComponent } from './component/upload-file/upload-file';
|
||||
import { TopMenuComponent } from './component/top-menu/top-menu';
|
||||
import { ElementTypeComponent } from './component/element-type/element-type';
|
||||
import { ElementGroupComponent } from './component/element-group/element-group';
|
||||
import { ElementSaisonComponent } from './component/element-saison/element-saison';
|
||||
import { ElementSeriesComponent } from './component/element-series/element-series';
|
||||
import { ElementSeasonComponent } from './component/element-season/element-season';
|
||||
import { ElementVideoComponent } from './component/element-video/element-video';
|
||||
import { CreateTypeComponent } from './component/create-type/create-type';
|
||||
import { PopInUploadProgress } from './component/upload-progress/upload-progress';
|
||||
import { PopInComponent } from './component/popin/popin';
|
||||
|
||||
import { HelpComponent } from './scene/help/help';
|
||||
import { LoginComponent } from './scene/login/login';
|
||||
import { SignUpComponent } from './scene/sign-up/sign-up';
|
||||
import { ValidateEmailComponent } from './scene/validate-email/validate-email';
|
||||
import { HomeComponent } from './scene/home/home';
|
||||
import { TypeComponent } from './scene/type/type';
|
||||
import { UniversComponent } from './scene/univers/univers';
|
||||
import { GroupComponent } from './scene/group/group';
|
||||
import { SaisonComponent } from './scene/saison/saison';
|
||||
import { VideoComponent } from './scene/video/video';
|
||||
import { SettingsComponent } from './scene/settings/settings';
|
||||
import { ErrorViewerComponent } from './scene/error-viewer/error-viewer';
|
||||
import { HelpScene } from './scene/help/help';
|
||||
import { LoginScene } from './scene/login/login';
|
||||
import { SignUpScene } from './scene/sign-up/sign-up';
|
||||
import { ValidateEmailScene } from './scene/validate-email/validate-email';
|
||||
import { HomeScene } from './scene/home/home';
|
||||
import { TypeScene } from './scene/type/type';
|
||||
import { UniverseScene } from './scene/universe/universe';
|
||||
import { SeriesScene } from './scene/series/series';
|
||||
import { SeasonScene } from './scene/season/season';
|
||||
import { VideoScene } from './scene/video/video';
|
||||
import { SettingsScene } from './scene/settings/settings';
|
||||
import { ErrorViewerScene } from './scene/error-viewer/error-viewer';
|
||||
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 { SaisonEditComponent } from './scene/saison-edit/saison-edit';
|
||||
import { GroupEditComponent } from './scene/group-edit/group-edit';
|
||||
import { SeasonEditScene } from './scene/season-edit/season-edit';
|
||||
import { SeriesEditScene } from './scene/series-edit/series-edit';
|
||||
|
||||
import { AuthService } from './service/auth';
|
||||
import { ArianeService } from './service/ariane';
|
||||
@ -52,15 +52,17 @@ import { CookiesService } from './service/cookies';
|
||||
import { HttpWrapperService } from './service/http-wrapper';
|
||||
import { HttpOAuthWrapperService } from './service/http-oauth-wrapper';
|
||||
import { UserService } from './service/user';
|
||||
import { UniversService } from './service/univers';
|
||||
import { GroupService } from './service/group';
|
||||
import { UniverseService } from './service/universe';
|
||||
import { SeriesService } from './service/series';
|
||||
import { DataService } from './service/data';
|
||||
import { TypeService } from './service/type';
|
||||
import { SaisonService } from './service/saison';
|
||||
import { SeasonService } from './service/season';
|
||||
import { VideoService } from './service/video';
|
||||
import { SessionService } from './service/session';
|
||||
import { BddService } from './service/bdd';
|
||||
import { PopInService } from './service/popin';
|
||||
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
@NgModule({
|
||||
@ -68,26 +70,26 @@ import { AppComponent } from './app.component';
|
||||
AppComponent,
|
||||
TopMenuComponent,
|
||||
UploadFileComponent,
|
||||
HelpComponent,
|
||||
HelpScene,
|
||||
ElementTypeComponent,
|
||||
ElementGroupComponent,
|
||||
ElementSaisonComponent,
|
||||
ElementSeriesComponent,
|
||||
ElementSeasonComponent,
|
||||
ElementVideoComponent,
|
||||
LoginComponent,
|
||||
SignUpComponent,
|
||||
ValidateEmailComponent,
|
||||
HomeComponent,
|
||||
TypeComponent,
|
||||
UniversComponent,
|
||||
GroupComponent,
|
||||
SaisonComponent,
|
||||
VideoComponent,
|
||||
SettingsComponent,
|
||||
ErrorViewerComponent,
|
||||
LoginScene,
|
||||
SignUpScene,
|
||||
ValidateEmailScene,
|
||||
HomeScene,
|
||||
TypeScene,
|
||||
UniverseScene,
|
||||
SeriesScene,
|
||||
SeasonScene,
|
||||
VideoScene,
|
||||
SettingsScene,
|
||||
ErrorViewerScene,
|
||||
ErrorComponent,
|
||||
VideoEditComponent,
|
||||
SaisonEditComponent,
|
||||
GroupEditComponent,
|
||||
VideoEditScene,
|
||||
SeasonEditScene,
|
||||
SeriesEditScene,
|
||||
PopInComponent,
|
||||
PopInUploadProgress,
|
||||
CreateTypeComponent,
|
||||
@ -115,9 +117,9 @@ import { AppComponent } from './app.component';
|
||||
UserService,
|
||||
TypeService,
|
||||
DataService,
|
||||
UniversService,
|
||||
GroupService,
|
||||
SaisonService,
|
||||
UniverseService,
|
||||
SeriesService,
|
||||
SeasonService,
|
||||
VideoService,
|
||||
ArianeService
|
||||
],
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="saison-small">
|
||||
Saison {{numberSaison}}
|
||||
<div class="season-small">
|
||||
Season {{numberSeason}}
|
||||
</div>
|
||||
<div class="description-small" *ngIf="count > 1">
|
||||
{{count}} Episodes
|
@ -9,55 +9,55 @@ import { Injectable, Component, OnInit, Input } from '@angular/core';
|
||||
|
||||
import { Router } from "@angular/router";
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { SaisonService } from '../../service/saison';
|
||||
import { SeasonService } from '../../service/season';
|
||||
|
||||
@Component({
|
||||
selector: 'app-element-saison',
|
||||
templateUrl: './element-saison.html',
|
||||
styleUrls: ['./element-saison.less']
|
||||
selector: 'app-element-season',
|
||||
templateUrl: './element-season.html',
|
||||
styleUrls: ['./element-season.less']
|
||||
})
|
||||
|
||||
@Injectable()
|
||||
export class ElementSaisonComponent implements OnInit {
|
||||
export class ElementSeasonComponent implements OnInit {
|
||||
// input parameters
|
||||
@Input() id_saison:number = -1;
|
||||
@Input() id_season:number = -1;
|
||||
|
||||
error:string = "";
|
||||
numberSaison:number = -1;
|
||||
numberSeason:number = -1;
|
||||
count:number = null;
|
||||
cover:string = "";
|
||||
covers:Array<string> = [];
|
||||
description:string = "";
|
||||
|
||||
constructor(private router: Router,
|
||||
private saisonService: SaisonService) {
|
||||
private seasonService: SeasonService) {
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
let self = this;
|
||||
console.log("get saison properties id: " + this.id_saison);
|
||||
this.saisonService.get(this.id_saison)
|
||||
console.log("get season properties id: " + this.id_season);
|
||||
this.seasonService.get(this.id_season)
|
||||
.then(function(response) {
|
||||
self.error = "";
|
||||
self.numberSaison = response.name;
|
||||
self.numberSeason = response.name;
|
||||
self.description = response.description;
|
||||
if (response.covers == undefined || response.covers == null || response.covers.length == 0) {
|
||||
self.cover = null;
|
||||
//self.covers = [];
|
||||
} 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++) {
|
||||
self.covers.push(self.saisonService.getCoverThumbnailUrl(response.covers[iii]));
|
||||
self.covers.push(self.seasonService.getCoverThumbnailUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
}).catch(function(response) {
|
||||
self.error = "Can not get the data";
|
||||
self.numberSaison = -1
|
||||
self.numberSeason = -1
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
self.description = "";
|
||||
});
|
||||
this.saisonService.countVideo(this.id_saison)
|
||||
this.seasonService.countVideo(this.id_season)
|
||||
.then(function(response) {
|
||||
self.count = response;
|
||||
}).catch(function(response) {
|
@ -9,18 +9,18 @@ import { Injectable, Component, OnInit, Input } from '@angular/core';
|
||||
|
||||
import { Router } from "@angular/router";
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { GroupService } from '../../service/group';
|
||||
import { SeriesService } from '../../service/series';
|
||||
|
||||
@Component({
|
||||
selector: 'app-element-group',
|
||||
templateUrl: './element-group.html',
|
||||
styleUrls: ['./element-group.less']
|
||||
selector: 'app-element-series',
|
||||
templateUrl: './element-series.html',
|
||||
styleUrls: ['./element-series.less']
|
||||
})
|
||||
|
||||
@Injectable()
|
||||
export class ElementGroupComponent implements OnInit {
|
||||
export class ElementSeriesComponent implements OnInit {
|
||||
// input parameters
|
||||
@Input() id_group:number = -1;
|
||||
@Input() id_series:number = -1;
|
||||
@Input() id_type:number = -1;
|
||||
|
||||
error:string = "";
|
||||
@ -32,14 +32,14 @@ export class ElementGroupComponent implements OnInit {
|
||||
covers:Array<string> = [];
|
||||
|
||||
constructor(private router: Router,
|
||||
private groupService: GroupService) {
|
||||
private seriesService: SeriesService) {
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.name = "ll " + this.id_type + "+" + this.id_group
|
||||
this.name = "ll " + this.id_type + "+" + this.id_series
|
||||
let self = this;
|
||||
console.log("get parameter id: " + this.id_type);
|
||||
this.groupService.get(this.id_group)
|
||||
this.seriesService.get(this.id_series)
|
||||
.then(function(response) {
|
||||
self.error = "";
|
||||
self.name = response.name
|
||||
@ -47,9 +47,9 @@ export class ElementGroupComponent implements OnInit {
|
||||
self.cover = null;
|
||||
//self.covers = [];
|
||||
} 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++) {
|
||||
self.covers.push(self.groupService.getCoverThumbnailUrl(response.covers[iii]));
|
||||
self.covers.push(self.seriesService.getCoverThumbnailUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
}).catch(function(response) {
|
@ -29,8 +29,8 @@ export class ElementVideoComponent implements OnInit {
|
||||
name:string = "";
|
||||
description:string = "";
|
||||
episode:number = undefined;
|
||||
group_id:number = undefined;
|
||||
saison_id:number = undefined;
|
||||
series_id:number = undefined;
|
||||
season_id:number = undefined;
|
||||
data_id:number = -1;
|
||||
time:number = undefined;
|
||||
type_id:number = undefined;
|
||||
@ -68,8 +68,8 @@ export class ElementVideoComponent implements OnInit {
|
||||
} else {
|
||||
self.episode_display = response.episode + " - ";
|
||||
}
|
||||
self.group_id = response.serie_id;
|
||||
self.saison_id = response.saison_id;
|
||||
self.series_id = response.series_id;
|
||||
self.season_id = response.season_id;
|
||||
self.data_id = response.data_id;
|
||||
self.time = response.time;
|
||||
self.generated_name = response.generated_name;
|
||||
@ -97,8 +97,8 @@ export class ElementVideoComponent implements OnInit {
|
||||
self.description = "";
|
||||
self.episode = undefined;
|
||||
self.episode_display = "";
|
||||
self.group_id = undefined;
|
||||
self.saison_id = undefined;
|
||||
self.series_id = undefined;
|
||||
self.season_id = undefined;
|
||||
self.data_id = -1;
|
||||
self.time = undefined;
|
||||
self.generated_name = "";
|
||||
|
@ -23,40 +23,40 @@
|
||||
T
|
||||
</div>
|
||||
</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"
|
||||
*ngIf="ariane_univers_id != null"
|
||||
title="Univers"
|
||||
(click)="onArianeUnivers($event)"
|
||||
(auxclick)="onArianeUnivers($event)">
|
||||
*ngIf="ariane_universe_id != null"
|
||||
title="Universe"
|
||||
(click)="onArianeUniverse($event)"
|
||||
(auxclick)="onArianeUniverse($event)">
|
||||
<div class="xdesktop">
|
||||
{{ariane_univers_name}}
|
||||
{{ariane_universe_name}}
|
||||
</div>
|
||||
<div class="xmobile">
|
||||
U
|
||||
</div>
|
||||
</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"
|
||||
*ngIf="ariane_group_id != null"
|
||||
title="Group"
|
||||
(click)="onArianeGroup($event)"
|
||||
(auxclick)="onArianeGroup($event)">
|
||||
*ngIf="ariane_series_id != null"
|
||||
title="Series"
|
||||
(click)="onArianeSeries($event)"
|
||||
(auxclick)="onArianeSeries($event)">
|
||||
<div class="xdesktop">
|
||||
{{ariane_group_name}}
|
||||
{{ariane_series_name}}
|
||||
</div>
|
||||
<div class="xmobile">
|
||||
G
|
||||
</div>
|
||||
</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"
|
||||
*ngIf="ariane_saison_id != null"
|
||||
title="Saison"
|
||||
(click)="onArianeSaison($event)"
|
||||
(auxclick)="onArianeSaison($event)">
|
||||
*ngIf="ariane_season_id != null"
|
||||
title="Season"
|
||||
(click)="onArianeSeason($event)"
|
||||
(auxclick)="onArianeSeason($event)">
|
||||
<div class="xdesktop">
|
||||
{{ariane_saison_name}}
|
||||
{{ariane_season_name}}
|
||||
</div>
|
||||
<div class="xmobile">
|
||||
S
|
||||
@ -145,23 +145,23 @@
|
||||
<b>Edit Type</b>
|
||||
</button>
|
||||
<button class="item"
|
||||
*ngIf="ariane_univers_id != null"
|
||||
(click)="onSubEditUnivers($event)"
|
||||
(auxclick)="onSubEditUnivers($event)">
|
||||
<b>Edit Univers</b>
|
||||
*ngIf="ariane_universe_id != null"
|
||||
(click)="onSubEditUniverse($event)"
|
||||
(auxclick)="onSubEditUniverse($event)">
|
||||
<b>Edit Universe</b>
|
||||
</button>
|
||||
-->
|
||||
<button class="item"
|
||||
*ngIf="ariane_group_id != null"
|
||||
(click)="onSubEditGroup($event)"
|
||||
(auxclick)="onSubEditGroup($event)">
|
||||
<b>Edit Group</b>
|
||||
*ngIf="ariane_series_id != null"
|
||||
(click)="onSubEditSeries($event)"
|
||||
(auxclick)="onSubEditSeries($event)">
|
||||
<b>Edit Series</b>
|
||||
</button>
|
||||
<button class="item"
|
||||
*ngIf="ariane_saison_id != null"
|
||||
(click)="onSubEditSaison($event)"
|
||||
(auxclick)="onSubEditSaison($event)">
|
||||
<b>Edit Saison</b>
|
||||
*ngIf="ariane_season_id != null"
|
||||
(click)="onSubEditSeason($event)"
|
||||
(auxclick)="onSubEditSeason($event)">
|
||||
<b>Edit Season</b>
|
||||
</button>
|
||||
<button class="item"
|
||||
*ngIf="ariane_video_id != null"
|
||||
@ -181,23 +181,23 @@
|
||||
<b>Edit Type</b>
|
||||
</button>
|
||||
<button class="item"
|
||||
*ngIf="ariane_univers_id != null"
|
||||
(click)="onSubEditUnivers($event)"
|
||||
(auxclick)="onSubEditUnivers($event)">
|
||||
<b>Edit Univers</b>
|
||||
*ngIf="ariane_universe_id != null"
|
||||
(click)="onSubEditUniverse($event)"
|
||||
(auxclick)="onSubEditUniverse($event)">
|
||||
<b>Edit Universe</b>
|
||||
</button>
|
||||
-->
|
||||
<button class="item"
|
||||
*ngIf="ariane_group_id != null"
|
||||
(click)="onSubEditGroup($event)"
|
||||
(auxclick)="onSubEditGroup($event)">
|
||||
<b>Edit Group</b>
|
||||
*ngIf="ariane_series_id != null"
|
||||
(click)="onSubEditSeries($event)"
|
||||
(auxclick)="onSubEditSeries($event)">
|
||||
<b>Edit Series</b>
|
||||
</button>
|
||||
<button class="item"
|
||||
*ngIf="ariane_saison_id != null"
|
||||
(click)="onSubEditSaison($event)"
|
||||
(auxclick)="onSubEditSaison($event)">
|
||||
<b>Edit Saison</b>
|
||||
*ngIf="ariane_season_id != null"
|
||||
(click)="onSubEditSeason($event)"
|
||||
(auxclick)="onSubEditSeason($event)">
|
||||
<b>Edit Season</b>
|
||||
</button>
|
||||
<button class="item"
|
||||
*ngIf="ariane_video_id != null"
|
||||
|
@ -27,14 +27,14 @@ export class TopMenuComponent implements OnInit {
|
||||
public ariane_type_id: number = null;
|
||||
public ariane_type_name: string = null;
|
||||
|
||||
public ariane_univers_id: number = null;
|
||||
public ariane_univers_name: string = null;
|
||||
public ariane_universe_id: number = null;
|
||||
public ariane_universe_name: string = null;
|
||||
|
||||
public ariane_group_id: number = null;
|
||||
public ariane_group_name: string = null;
|
||||
public ariane_series_id: number = null;
|
||||
public ariane_series_name: string = null;
|
||||
|
||||
public ariane_saison_id: number = null;
|
||||
public ariane_saison_name: string = null;
|
||||
public ariane_season_id: number = null;
|
||||
public ariane_season_name: string = null;
|
||||
|
||||
public ariane_video_id: number = null;
|
||||
public ariane_video_name: string = null;
|
||||
@ -67,19 +67,19 @@ export class TopMenuComponent implements OnInit {
|
||||
this.ariane_type_name = this.arianeService.getTypeName();
|
||||
this.updateEditShow();
|
||||
});
|
||||
this.arianeService.univers_change.subscribe(univers_id => {
|
||||
this.ariane_univers_id = univers_id;
|
||||
this.ariane_univers_name = this.arianeService.getUniversName();
|
||||
this.arianeService.universe_change.subscribe(univers_id => {
|
||||
this.ariane_universe_id = univers_id;
|
||||
this.ariane_universe_name = this.arianeService.getUniverseName();
|
||||
this.updateEditShow();
|
||||
});
|
||||
this.arianeService.group_change.subscribe(group_id => {
|
||||
this.ariane_group_id = group_id;
|
||||
this.ariane_group_name = this.arianeService.getGroupName();
|
||||
this.arianeService.series_change.subscribe(series_id => {
|
||||
this.ariane_series_id = series_id;
|
||||
this.ariane_series_name = this.arianeService.getSeriesName();
|
||||
this.updateEditShow();
|
||||
});
|
||||
this.arianeService.saison_change.subscribe(saison_id => {
|
||||
this.ariane_saison_id = saison_id;
|
||||
this.ariane_saison_name = this.arianeService.getSaisonName();
|
||||
this.arianeService.season_change.subscribe(season_id => {
|
||||
this.ariane_season_id = season_id;
|
||||
this.ariane_season_name = this.arianeService.getSeasonName();
|
||||
this.updateEditShow();
|
||||
});
|
||||
this.arianeService.video_change.subscribe(video_id => {
|
||||
@ -90,9 +90,9 @@ export class TopMenuComponent implements OnInit {
|
||||
}
|
||||
updateEditShow():void {
|
||||
this.edit_show = /* this.ariane_type_id != null
|
||||
|| this.ariane_univers_id != null
|
||||
||*/ this.ariane_group_id != null
|
||||
|| this.ariane_saison_id != null
|
||||
|| this.ariane_universe_id != null
|
||||
||*/ this.ariane_series_id != null
|
||||
|| this.ariane_season_id != null
|
||||
|| this.ariane_video_id != null;
|
||||
}
|
||||
onAvatar(): void {
|
||||
@ -112,23 +112,23 @@ export class TopMenuComponent implements OnInit {
|
||||
this.displayUserMenu = false;
|
||||
this.arianeService.navigateVideoEdit(this.ariane_video_id, _event.which==2);
|
||||
}
|
||||
onSubEditSaison(_event: any): void {
|
||||
onSubEditSeason(_event: any): void {
|
||||
console.log("onSubEdit()");
|
||||
this.displayEditMenu = 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()");
|
||||
this.displayEditMenu = 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()");
|
||||
this.displayEditMenu = 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 {
|
||||
console.log("onSubEditType()");
|
||||
@ -191,19 +191,19 @@ export class TopMenuComponent implements OnInit {
|
||||
this.arianeService.navigateType(this.ariane_type_id, _event.which==2);
|
||||
}
|
||||
|
||||
onArianeUnivers(_event: any): void {
|
||||
console.log("onArianeUnivers(" + this.ariane_univers_id + ")");
|
||||
this.arianeService.navigateUnivers(this.ariane_univers_id, _event.which==2);
|
||||
onArianeUniverse(_event: any): void {
|
||||
console.log("onArianeUniverse(" + this.ariane_universe_id + ")");
|
||||
this.arianeService.navigateUniverse(this.ariane_universe_id, _event.which==2);
|
||||
}
|
||||
|
||||
onArianeGroup(_event: any): void {
|
||||
console.log("onArianeGroup(" + this.ariane_group_id + ")");
|
||||
this.arianeService.navigateGroup(this.ariane_group_id, _event.which==2);
|
||||
onArianeSeries(_event: any): void {
|
||||
console.log("onArianeSeries(" + this.ariane_series_id + ")");
|
||||
this.arianeService.navigateSeries(this.ariane_series_id, _event.which==2);
|
||||
}
|
||||
|
||||
onArianeSaison(_event: any): void {
|
||||
console.log("onArianeSaison(" + this.ariane_saison_id + ")");
|
||||
this.arianeService.navigateSaison(this.ariane_saison_id, _event.which==2);
|
||||
onArianeSeason(_event: any): void {
|
||||
console.log("onArianeSeason(" + this.ariane_season_id + ")");
|
||||
this.arianeService.navigateSeason(this.ariane_season_id, _event.which==2);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import { ArianeService } from '../../service/ariane';
|
||||
templateUrl: './error-viewer.html',
|
||||
styleUrls: ['./error-viewer.less']
|
||||
})
|
||||
export class ErrorViewerComponent implements OnInit {
|
||||
export class ErrorViewerScene implements OnInit {
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private arianeService: ArianeService) { }
|
||||
|
@ -7,7 +7,7 @@ import { ArianeService } from '../../service/ariane';
|
||||
templateUrl: './help.html',
|
||||
styleUrls: ['./help.less']
|
||||
})
|
||||
export class HelpComponent implements OnInit {
|
||||
export class HelpScene implements OnInit {
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private arianeService: ArianeService) { }
|
||||
|
@ -11,7 +11,6 @@ import { fadeInAnimation } from '../../_animations/index';
|
||||
|
||||
import { TypeService } from '../../service/type';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@ -20,7 +19,7 @@ import { environment } from 'environments/environment';
|
||||
animations: [fadeInAnimation],
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
export class HomeScene implements OnInit {
|
||||
data_list = [];
|
||||
error = "";
|
||||
constructor(private route: ActivatedRoute,
|
||||
|
@ -50,7 +50,7 @@ declare function SHA512(param1: any): any;
|
||||
animations: [fadeInAnimation],
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
export class LoginScene implements OnInit {
|
||||
public loginOK:boolean = false;
|
||||
public loginHelp:string = "";
|
||||
public login:string = "";
|
||||
|
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="number"
|
||||
placeholder="Id of the saison"
|
||||
placeholder="Id of the season"
|
||||
[value]="numberVal"
|
||||
(input)="onNumber($event.target.value)"
|
||||
/>
|
@ -11,7 +11,7 @@ import { NgForm } from '@angular/forms';
|
||||
import { FormGroup, FormControl } from "@angular/forms";
|
||||
import { fadeInAnimation } from '../../_animations/index';
|
||||
|
||||
import { SaisonService } from '../../service/saison';
|
||||
import { SeasonService } from '../../service/season';
|
||||
import { DataService } from '../../service/data';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
|
||||
@ -25,15 +25,15 @@ export class ElementList {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-saison-edit',
|
||||
templateUrl: './saison-edit.html',
|
||||
styleUrls: ['./saison-edit.less'],
|
||||
selector: 'app-season-edit',
|
||||
templateUrl: './season-edit.html',
|
||||
styleUrls: ['./season-edit.less'],
|
||||
animations: [fadeInAnimation],
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
// https://www.sitepoint.com/angular-forms/
|
||||
export class SaisonEditComponent implements OnInit {
|
||||
id_saison:number = -1;
|
||||
export class SeasonEditScene implements OnInit {
|
||||
id_season:number = -1;
|
||||
|
||||
error:string = "";
|
||||
|
||||
@ -49,23 +49,23 @@ export class SaisonEditComponent implements OnInit {
|
||||
private router: Router,
|
||||
private locate: Location,
|
||||
private dataService: DataService,
|
||||
private saisonService: SaisonService,
|
||||
private seasonService: SeasonService,
|
||||
private arianeService: ArianeService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.arianeService.updateManual(this.route.snapshot.paramMap);
|
||||
this.id_saison = this.arianeService.getSaisonId();
|
||||
this.id_season = this.arianeService.getSeasonId();
|
||||
let self = this;
|
||||
this.saisonService.get(this.id_saison)
|
||||
this.seasonService.get(this.id_season)
|
||||
.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.description = response.description;
|
||||
if (response.covers !== undefined && response.covers !== null) {
|
||||
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 {
|
||||
self.covers_display = []
|
||||
@ -93,7 +93,7 @@ export class SaisonEditComponent implements OnInit {
|
||||
"number": this.numberVal,
|
||||
"description": this.description
|
||||
};
|
||||
this.saisonService.put(this.id_saison, data);
|
||||
this.seasonService.put(this.id_season, data);
|
||||
}
|
||||
|
||||
// At the drag drop area
|
||||
@ -127,12 +127,12 @@ export class SaisonEditComponent implements OnInit {
|
||||
let self = this;
|
||||
this.dataService.sendFile(_file)
|
||||
.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;
|
||||
self.saisonService.addCover(self.id_saison, id_of_image)
|
||||
self.seasonService.addCover(self.id_season, id_of_image)
|
||||
.then(function(response) {
|
||||
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) {
|
||||
console.log("Can not cover in the cover_list...");
|
||||
});
|
@ -1,9 +1,9 @@
|
||||
<div class="generic-page">
|
||||
<div *ngIf="group_name" class="title">
|
||||
{{group_name}}
|
||||
<div *ngIf="series_name" class="title">
|
||||
{{series_name}}
|
||||
</div>
|
||||
<div class="sub-title-main">
|
||||
Saison {{name}}
|
||||
Season {{name}}
|
||||
</div>
|
||||
<div class="cover" *ngIf="cover != null" >
|
||||
<img src="{{cover}}"/>
|
@ -9,79 +9,77 @@ import { Router, ActivatedRoute, ParamMap } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
import { fadeInAnimation } from '../../_animations/index';
|
||||
|
||||
import { SaisonService } from '../../service/saison';
|
||||
import { GroupService } from '../../service/group';
|
||||
import { SeasonService } from '../../service/season';
|
||||
import { SeriesService } from '../../service/series';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-saison',
|
||||
templateUrl: './saison.html',
|
||||
styleUrls: ['./saison.less'],
|
||||
selector: 'app-season',
|
||||
templateUrl: './season.html',
|
||||
styleUrls: ['./season.less'],
|
||||
animations: [fadeInAnimation],
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
|
||||
export class SaisonComponent implements OnInit {
|
||||
export class SeasonScene implements OnInit {
|
||||
name: string = "";
|
||||
group_name: string = "";
|
||||
series_name: string = "";
|
||||
description: string = "";
|
||||
group_id: number = null;
|
||||
series_id: number = null;
|
||||
cover: string = ""
|
||||
covers: Array<string> = []
|
||||
id_saison = -1;
|
||||
id_season = -1;
|
||||
videos_error = "";
|
||||
videos = [];
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private locate: Location,
|
||||
private saisonService: SaisonService,
|
||||
private groupService: GroupService,
|
||||
private seasonService: SeasonService,
|
||||
private seriesService: SeriesService,
|
||||
private arianeService: ArianeService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log("ngOnInit(SaisonComponent)");
|
||||
console.log("ngOnInit(SeasonComponent)");
|
||||
this.arianeService.updateManual(this.route.snapshot.paramMap);
|
||||
this.id_saison = this.arianeService.getSaisonId();
|
||||
this.id_season = this.arianeService.getSeasonId();
|
||||
|
||||
let self = this;
|
||||
this.saisonService.get(this.id_saison)
|
||||
.then(function(response) {
|
||||
this.seasonService.get(this.id_season)
|
||||
.then(function(response:any) {
|
||||
self.name = response.name;
|
||||
self.group_id = response.parent_id;
|
||||
self.series_id = response.parent_id;
|
||||
self.description = response.description;
|
||||
if (response.covers == undefined || response.covers == null || response.covers.length == 0) {
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
} 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++) {
|
||||
self.covers.push(self.groupService.getCoverUrl(response.covers[iii]));
|
||||
self.covers.push(self.seriesService.getCoverUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
self.groupService.get(self.group_id)
|
||||
.then(function(response) {
|
||||
self.group_name = response.name;
|
||||
}).catch(function(response) {
|
||||
self.group_name = "";
|
||||
self.seriesService.get(self.series_id)
|
||||
.then(function(response:any) {
|
||||
self.series_name = response.name;
|
||||
}).catch(function(response:any) {
|
||||
self.series_name = "";
|
||||
});
|
||||
}).catch(function(response) {
|
||||
}).catch(function(response:any) {
|
||||
self.description = "";
|
||||
self.name = "???";
|
||||
self.group_name = "";
|
||||
self.group_id = null;
|
||||
self.series_name = "";
|
||||
self.series_id = null;
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
});
|
||||
console.log("get parameter id: " + this.id_saison);
|
||||
this.saisonService.getVideo(this.id_saison)
|
||||
.then(function(response) {
|
||||
console.log("get parameter id: " + this.id_season);
|
||||
this.seasonService.getVideo(this.id_season)
|
||||
.then(function(response:any) {
|
||||
self.videos_error = "";
|
||||
self.videos = response
|
||||
}).catch(function(response) {
|
||||
self.videos_error = "Can not get the List of video without saison";
|
||||
}).catch(function(response:any) {
|
||||
self.videos_error = "Can not get the List of video without season";
|
||||
self.videos = []
|
||||
});
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="text"
|
||||
placeholder="Name of the Group"
|
||||
placeholder="Name of the Series"
|
||||
[value]="name"
|
||||
(input)="onName($event.target.value)"
|
||||
/>
|
@ -11,7 +11,7 @@ import { NgForm } from '@angular/forms';
|
||||
import { FormGroup, FormControl } from "@angular/forms";
|
||||
import { fadeInAnimation } from '../../_animations/index';
|
||||
|
||||
import { GroupService } from '../../service/group';
|
||||
import { SeriesService } from '../../service/series';
|
||||
import { DataService } from '../../service/data';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
|
||||
@ -25,15 +25,15 @@ export class ElementList {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-edit',
|
||||
templateUrl: './group-edit.html',
|
||||
styleUrls: ['./group-edit.less'],
|
||||
selector: 'app-series-edit',
|
||||
templateUrl: './series-edit.html',
|
||||
styleUrls: ['./series-edit.less'],
|
||||
animations: [fadeInAnimation],
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
// https://www.sitepoint.com/angular-forms/
|
||||
export class GroupEditComponent implements OnInit {
|
||||
id_group:number = -1;
|
||||
export class SeriesEditScene implements OnInit {
|
||||
id_series:number = -1;
|
||||
|
||||
error:string = ""
|
||||
|
||||
@ -49,23 +49,23 @@ export class GroupEditComponent implements OnInit {
|
||||
private router: Router,
|
||||
private locate: Location,
|
||||
private dataService: DataService,
|
||||
private groupService: GroupService,
|
||||
private seriesService: SeriesService,
|
||||
private arianeService: ArianeService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.arianeService.updateManual(this.route.snapshot.paramMap);
|
||||
this.id_group = this.arianeService.getGroupId();
|
||||
this.id_series = this.arianeService.getSeriesId();
|
||||
let self = this;
|
||||
this.groupService.get(this.id_group)
|
||||
this.seriesService.get(this.id_series)
|
||||
.then(function(response) {
|
||||
console.log("get response of video : " + JSON.stringify(response, null, 2));
|
||||
self.name = response.name;
|
||||
self.description = response.description;
|
||||
if (response.covers !== undefined && response.covers !== null) {
|
||||
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 {
|
||||
self.covers_display = []
|
||||
@ -93,7 +93,7 @@ export class GroupEditComponent implements OnInit {
|
||||
"name": this.name,
|
||||
"description": this.description
|
||||
};
|
||||
this.groupService.put(this.id_group, data);
|
||||
this.seriesService.put(this.id_series, data);
|
||||
}
|
||||
|
||||
// At the drag drop area
|
||||
@ -129,10 +129,10 @@ export class GroupEditComponent implements OnInit {
|
||||
.then(function(response) {
|
||||
console.log("get response of video : " + JSON.stringify(response, null, 2));
|
||||
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) {
|
||||
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) {
|
||||
console.log("Can not cover in the cover_list...");
|
||||
});
|
@ -8,10 +8,10 @@
|
||||
<div class="description" *ngIf="description">
|
||||
{{description}}
|
||||
</div>
|
||||
<div class="fill-all colomn_mutiple" *ngIf="saisons.length != 0">
|
||||
<div class="sub-title">Saisons:</div>
|
||||
<div *ngFor="let data of saisons" class="item-list" (click)="onSelectSaison($event, data.id)" (auxclick)="onSelectSaison($event, data.id)">
|
||||
<app-element-saison [id_saison]="data.id"></app-element-saison>
|
||||
<div class="fill-all colomn_mutiple" *ngIf="seasons.length != 0">
|
||||
<div class="sub-title">Seasons:</div>
|
||||
<div *ngFor="let data of seasons" class="item-list" (click)="onSelectSeason($event, data.id)" (auxclick)="onSelectSeason($event, data.id)">
|
||||
<app-element-season [id_season]="data.id"></app-element-season>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
@ -9,45 +9,44 @@ import { Router, ActivatedRoute, ParamMap } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
import { fadeInAnimation } from '../../_animations/index';
|
||||
|
||||
import { GroupService } from '../../service/group';
|
||||
import { SeriesService } from '../../service/series';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group',
|
||||
templateUrl: './group.html',
|
||||
styleUrls: ['./group.less'],
|
||||
selector: 'app-series',
|
||||
templateUrl: './series.html',
|
||||
styleUrls: ['./series.less'],
|
||||
animations: [fadeInAnimation],
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
|
||||
export class GroupComponent implements OnInit {
|
||||
export class SeriesScene implements OnInit {
|
||||
//id_type = -1;
|
||||
//id_univers = -1;
|
||||
id_group = -1;
|
||||
//id_universe = -1;
|
||||
id_series = -1;
|
||||
name: string = "";
|
||||
description: string = "";
|
||||
cover: string = ""
|
||||
covers: Array<string> = []
|
||||
saisons_error: string = "";
|
||||
saisons: Array<number> = [];
|
||||
seasons_error: string = "";
|
||||
seasons: Array<number> = [];
|
||||
videos_error: string = "";
|
||||
videos: Array<number> = [];
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private locate: Location,
|
||||
private groupService: GroupService,
|
||||
private seriesService: SeriesService,
|
||||
private arianeService: ArianeService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
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_group = this.arianeService.getGroupId();
|
||||
this.id_series = this.arianeService.getSeriesId();
|
||||
let self = this;
|
||||
this.groupService.get(this.id_group)
|
||||
this.seriesService.get(this.id_series)
|
||||
.then(function(response) {
|
||||
self.name = response.name;
|
||||
self.description = response.description;
|
||||
@ -55,9 +54,9 @@ export class GroupComponent implements OnInit {
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
} 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++) {
|
||||
self.covers.push(self.groupService.getCoverUrl(response.covers[iii]));
|
||||
self.covers.push(self.seriesService.getCoverUrl(response.covers[iii]));
|
||||
}
|
||||
}
|
||||
}).catch(function(response) {
|
||||
@ -66,26 +65,26 @@ export class GroupComponent implements OnInit {
|
||||
self.cover = null;
|
||||
self.covers = [];
|
||||
});
|
||||
console.log("get parameter id: " + this.id_group);
|
||||
this.groupService.getSaison(this.id_group, ["id", "name"])
|
||||
console.log("get parameter id: " + this.id_series);
|
||||
this.seriesService.getSeason(this.id_series, ["id", "name"])
|
||||
.then(function(response) {
|
||||
self.saisons_error = "";
|
||||
self.saisons = response
|
||||
self.seasons_error = "";
|
||||
self.seasons = response
|
||||
}).catch(function(response) {
|
||||
self.saisons_error = "Can not get the list of saison in this group";
|
||||
self.saisons = []
|
||||
self.seasons_error = "Can not get the list of season in this series";
|
||||
self.seasons = []
|
||||
});
|
||||
this.groupService.getVideo(this.id_group)
|
||||
this.seriesService.getVideo(this.id_series)
|
||||
.then(function(response) {
|
||||
self.videos_error = "";
|
||||
self.videos = 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 = []
|
||||
});
|
||||
}
|
||||
onSelectSaison(_event: any, _idSelected: number):void {
|
||||
this.arianeService.navigateSaison(_idSelected, _event.which==2);
|
||||
onSelectSeason(_event: any, _idSelected: number):void {
|
||||
this.arianeService.navigateSeason(_idSelected, _event.which==2);
|
||||
}
|
||||
|
||||
onSelectVideo(_event: any, _idSelected: number):void {
|
@ -13,7 +13,7 @@ import { ArianeService } from '../../service/ariane';
|
||||
templateUrl: './settings.html',
|
||||
styleUrls: ['./settings.less']
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
export class SettingsScene implements OnInit {
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private arianeService: ArianeService) { }
|
||||
|
@ -20,7 +20,7 @@ import { ArianeService } from '../../service/ariane';
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
|
||||
export class SignUpComponent implements OnInit {
|
||||
export class SignUpScene implements OnInit {
|
||||
|
||||
private signUp_iconWrong:string = "icon-right-not-validate";
|
||||
private signUp_iconWait:string = "icon-right-load";
|
||||
|
@ -9,8 +9,8 @@
|
||||
{{description}}
|
||||
</div>
|
||||
<div class="fill-all colomn_mutiple">
|
||||
<div *ngFor="let data of groups" class="item" (click)="onSelectGroup($event, data.id)" (auxclick)="onSelectGroup($event, data.id)">
|
||||
<app-element-group [id_type]="type_id" [id_group]="data.id"></app-element-group>
|
||||
<div *ngFor="let data of seriess" class="item" (click)="onSelectSeries($event, data.id)" (auxclick)="onSelectSeries($event, data.id)">
|
||||
<app-element-series [id_type]="type_id" [id_series]="data.id"></app-element-series>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
@ -11,7 +11,7 @@ import { fadeInAnimation } from '../../_animations/index';
|
||||
|
||||
import { TypeService } from '../../service/type';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
import { environment } from 'environments/environment';
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-type',
|
||||
@ -21,13 +21,13 @@ import { environment } from 'environments/environment';
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
|
||||
export class TypeComponent implements OnInit {
|
||||
export class TypeScene implements OnInit {
|
||||
type_id = -1;
|
||||
name: string = "";
|
||||
description: string = "";
|
||||
cover:string = null;
|
||||
groups_error = "";
|
||||
groups = [];
|
||||
seriess_error = "";
|
||||
seriess = [];
|
||||
videos_error = "";
|
||||
videos = [];
|
||||
constructor(private route: ActivatedRoute,
|
||||
@ -58,13 +58,13 @@ export class TypeComponent implements OnInit {
|
||||
self.name = "???";
|
||||
self.description = "";
|
||||
});
|
||||
this.typeService.getSubGroup(this.type_id, ["id", "name"])
|
||||
this.typeService.getSubSeries(this.type_id, ["id", "name"])
|
||||
.then(function(response) {
|
||||
self.groups_error = "";
|
||||
self.groups = response
|
||||
self.seriess_error = "";
|
||||
self.seriess = response
|
||||
}).catch(function(response) {
|
||||
self.groups_error = "Wrong e-mail/login or password";
|
||||
self.groups = []
|
||||
self.seriess_error = "Wrong e-mail/login or password";
|
||||
self.seriess = []
|
||||
});
|
||||
this.typeService.getSubVideo(this.type_id, ["id", "name"])
|
||||
.then(function(response) {
|
||||
@ -75,8 +75,8 @@ export class TypeComponent implements OnInit {
|
||||
self.videos = []
|
||||
});
|
||||
}
|
||||
onSelectGroup(_event: any, _idSelected: number):void {
|
||||
this.arianeService.navigateGroup(_idSelected, _event.which==2);
|
||||
onSelectSeries(_event: any, _idSelected: number):void {
|
||||
this.arianeService.navigateSeries(_idSelected, _event.which==2);
|
||||
}
|
||||
|
||||
onSelectVideo(_event: any, _idSelected: number):void {
|
||||
|
@ -9,43 +9,43 @@ import { Router, ActivatedRoute, ParamMap } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
import { fadeInAnimation } from '../../_animations/index';
|
||||
|
||||
import { UniversService } from '../../service/univers';
|
||||
import { UniverseService } from '../../service/universe';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-univers',
|
||||
templateUrl: './univers.html',
|
||||
styleUrls: ['./univers.less'],
|
||||
selector: 'app-universe',
|
||||
templateUrl: './universe.html',
|
||||
styleUrls: ['./universe.less'],
|
||||
animations: [fadeInAnimation],
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
|
||||
export class UniversComponent implements OnInit {
|
||||
univers_id = -1;
|
||||
export class UniverseScene implements OnInit {
|
||||
universe_id = -1;
|
||||
videos_error = "";
|
||||
videos = [];
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private locate: Location,
|
||||
private universService: UniversService,
|
||||
private universeService: UniverseService,
|
||||
private arianeService: ArianeService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.arianeService.updateManual(this.route.snapshot.paramMap);
|
||||
this.univers_id = this.arianeService.getUniversId();
|
||||
this.universe_id = this.arianeService.getUniverseId();
|
||||
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) {
|
||||
self.videos_error = "";
|
||||
self.videos = 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 = []
|
||||
});
|
||||
*/
|
@ -78,8 +78,8 @@
|
||||
<div class="input">
|
||||
<input type="text"
|
||||
placeholder="Series of the Media"
|
||||
[value]="parse_serie"
|
||||
(input)="onSerie($event.target.value)"
|
||||
[value]="parse_series"
|
||||
(input)="onSeries($event.target.value)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -88,15 +88,15 @@
|
||||
==>
|
||||
</div>
|
||||
<div class="input">
|
||||
<!-- <ngx-select-dropdown [config]="config" [options]="listGroup2"
|
||||
[(ngModel)]="parse_serie" [multiple]="false" ></ngx-select-dropdown>-->
|
||||
<select [ngModel]="serie_id"
|
||||
(ngModelChange)="onChangeGroup($event)">
|
||||
<option *ngFor="let element of listGroup" [ngValue]="element.value">{{element.label}}</option>
|
||||
<!-- <ngx-select-dropdown [config]="config" [options]="listSeries2"
|
||||
[(ngModel)]="parse_series" [multiple]="false" ></ngx-select-dropdown>-->
|
||||
<select [ngModel]="series_id"
|
||||
(ngModelChange)="onChangeSeries($event)">
|
||||
<option *ngFor="let element of listSeries" [ngValue]="element.value">{{element.label}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- <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>
|
||||
</button>
|
||||
</div>-->
|
||||
@ -108,9 +108,9 @@
|
||||
<div class="input">
|
||||
<input type="number"
|
||||
pattern="[0-9]{0-4}"
|
||||
placeholder="saison of the Media"
|
||||
[value]="parse_saison"
|
||||
(input)="onSaison($event.target.value)"
|
||||
placeholder="season of the Media"
|
||||
[value]="parse_season"
|
||||
(input)="onSeason($event.target.value)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,8 +16,8 @@ import { HttpEventType, HttpResponse } from '@angular/common/http';
|
||||
|
||||
import { PopInService } from '../../service/popin';
|
||||
import { TypeService } from '../../service/type';
|
||||
import { UniversService } from '../../service/univers';
|
||||
import { GroupService } from '../../service/group';
|
||||
import { UniverseService } from '../../service/universe';
|
||||
import { SeriesService } from '../../service/series';
|
||||
import { VideoService } from '../../service/video';
|
||||
import { DataService } from '../../service/data';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
@ -49,7 +49,7 @@ export class UploadScene implements OnInit {
|
||||
upload_file_value: string = ""
|
||||
selectedFiles: FileList;
|
||||
type_id: number = undefined
|
||||
serie_id: number = undefined
|
||||
series_id: number = undefined
|
||||
need_send: boolean = false;
|
||||
|
||||
covers_display: Array<any> = [];
|
||||
@ -65,14 +65,14 @@ export class UploadScene implements OnInit {
|
||||
listType: ElementList[] = [
|
||||
{ value: undefined, label: '---' },
|
||||
];
|
||||
listUnivers: ElementList[] = [
|
||||
listUniverse: ElementList[] = [
|
||||
{ value: undefined, label: '---' },
|
||||
{ value: null, label: '---' },
|
||||
];
|
||||
listGroup: ElementList[] = [
|
||||
listSeries: ElementList[] = [
|
||||
{ value: undefined, label: '---' },
|
||||
];
|
||||
listGroup2 = [{ id: undefined, description: '---' }];
|
||||
listSeries2 = [{ id: undefined, description: '---' }];
|
||||
/*
|
||||
config = {
|
||||
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,
|
||||
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: '---' },
|
||||
];
|
||||
parse_universe: string = "";
|
||||
parse_serie: string = "";
|
||||
parse_saison: number = null;
|
||||
parse_series: string = "";
|
||||
parse_season: number = null;
|
||||
parse_episode: number = null;
|
||||
parse_title: string = "";
|
||||
constructor(private route: ActivatedRoute,
|
||||
@ -105,8 +105,8 @@ export class UploadScene implements OnInit {
|
||||
private locate: Location,
|
||||
private dataService: DataService,
|
||||
private typeService: TypeService,
|
||||
private universService: UniversService,
|
||||
private groupService: GroupService,
|
||||
private universeService: UniverseService,
|
||||
private seriesService: SeriesService,
|
||||
private videoService: VideoService,
|
||||
private httpService: HttpWrapperService,
|
||||
private arianeService: ArianeService,
|
||||
@ -134,13 +134,13 @@ export class UploadScene implements OnInit {
|
||||
this.id_video = this.arianeService.getVideoId();
|
||||
let self = this;
|
||||
this.listType = [{ value: undefined, label: '---' }];
|
||||
this.listUnivers = [{ value: undefined, label: '---' }];
|
||||
this.listGroup = [{ value: undefined, label: '---' }];
|
||||
this.listSaison = [{ value: undefined, label: '---' }];
|
||||
this.universService.getData()
|
||||
this.listUniverse = [{ value: undefined, label: '---' }];
|
||||
this.listSeries = [{ value: undefined, label: '---' }];
|
||||
this.listSeason = [{ value: undefined, label: '---' }];
|
||||
this.universeService.getData()
|
||||
.then(function (response2) {
|
||||
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) {
|
||||
console.log("get response22 : " + JSON.stringify(response2, null, 2));
|
||||
@ -153,12 +153,12 @@ export class UploadScene implements OnInit {
|
||||
}).catch(function (response2) {
|
||||
console.log("get response22 : " + JSON.stringify(response2, null, 2));
|
||||
});
|
||||
//this.groupService.getOrder()
|
||||
this.groupService.getData()
|
||||
//this.seriesService.getOrder()
|
||||
this.seriesService.getData()
|
||||
.then(function (response3) {
|
||||
for (let iii = 0; iii < response3.length; iii++) {
|
||||
self.listGroup.push({ value: response3[iii].id, label: response3[iii].name });
|
||||
//console.log("Get serie: " + response3[iii].id + ", label:" + response3[iii].name)
|
||||
self.listSeries.push({ value: response3[iii].id, label: response3[iii].name });
|
||||
//console.log("Get series: " + response3[iii].id + ", label:" + response3[iii].name)
|
||||
}
|
||||
}).catch(function (response3) {
|
||||
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.description = response.description;
|
||||
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.time = response.time;
|
||||
self.data.generated_name = response.generated_name;
|
||||
self.onChangeType(response.type_id);
|
||||
self.onChangeGroup(response.serie_id);
|
||||
self.data.saison_id = response.saison_id;
|
||||
self.onChangeSeries(response.series_id);
|
||||
self.data.season_id = response.season_id;
|
||||
self.data_ori = self.data.clone();
|
||||
if (response.covers !== undefined && response.covers !== null) {
|
||||
for (let iii = 0; iii < response.covers.length; iii++) {
|
||||
@ -205,18 +205,18 @@ export class UploadScene implements OnInit {
|
||||
onChangeType (_value: any): void {
|
||||
console.log("Change requested of type ... " + _value);
|
||||
this.type_id = _value;
|
||||
//this.data.serie_id = null;
|
||||
//this.data.saison_id = null;
|
||||
//this.listGroup = [{value: undefined, label: '---'}];
|
||||
//this.listSaison = [{value: undefined, label: '---'}];
|
||||
//this.data.series_id = null;
|
||||
//this.data.season_id = null;
|
||||
//this.listSeries = [{value: undefined, label: '---'}];
|
||||
//this.listSeason = [{value: undefined, label: '---'}];
|
||||
let self = this;
|
||||
this.updateNeedSend();
|
||||
/*
|
||||
if (this.type_id != undefined) {
|
||||
self.typeService.getSubGroup(this.type_id, ["id", "name"])
|
||||
self.typeService.getSubSeries(this.type_id, ["id", "name"])
|
||||
.then(function(response2) {
|
||||
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) {
|
||||
console.log("get response22 : " + JSON.stringify(response2, null, 2));
|
||||
@ -225,22 +225,22 @@ export class UploadScene implements OnInit {
|
||||
*/
|
||||
}
|
||||
|
||||
onChangeGroup (_value: any): void {
|
||||
this.serie_id = _value;
|
||||
onChangeSeries (_value: any): void {
|
||||
this.series_id = _value;
|
||||
if (_value === undefined || _value === null) {
|
||||
|
||||
} else {
|
||||
for (let iii = 0 ; iii<this.listGroup.length ; iii++) {
|
||||
if (this.listGroup[iii].value == _value) {
|
||||
this.parse_serie = this.listGroup[iii].label;
|
||||
for (let iii = 0 ; iii<this.listSeries.length ; iii++) {
|
||||
if (this.listSeries[iii].value == _value) {
|
||||
this.parse_series = this.listSeries[iii].label;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateNeedSend();
|
||||
}
|
||||
onSaison (_value: any): void {
|
||||
this.parse_saison = _value;
|
||||
onSeason (_value: any): void {
|
||||
this.parse_season = _value;
|
||||
this.updateNeedSend();
|
||||
}
|
||||
|
||||
@ -258,17 +258,17 @@ export class UploadScene implements OnInit {
|
||||
this.parse_episode = parseInt(_value.value, 10);
|
||||
this.updateNeedSend();
|
||||
}
|
||||
onSerie (_value: any): void {
|
||||
this.parse_serie = _value;
|
||||
onSeries (_value: any): void {
|
||||
this.parse_series = _value;
|
||||
let self = this;
|
||||
if (this.parse_serie != "") {
|
||||
this.groupService.getLike(this.parse_serie)
|
||||
if (this.parse_series != "") {
|
||||
this.seriesService.getLike(this.parse_series)
|
||||
.then(function(response) {
|
||||
console.log("find elemet: " + response.name + " " + response.id);
|
||||
self.serie_id = response.id;
|
||||
self.series_id = response.id;
|
||||
}).catch(function(response) {
|
||||
console.log("CAN NOT find element: " );
|
||||
self.serie_id = null;
|
||||
self.series_id = null;
|
||||
});
|
||||
}
|
||||
this.updateNeedSend();
|
||||
@ -297,8 +297,8 @@ export class UploadScene implements OnInit {
|
||||
// (change)="selectFile($event)"
|
||||
onChangeFile (_value: any): void {
|
||||
this.parse_universe = "";
|
||||
this.parse_serie = "";
|
||||
this.parse_saison = null;
|
||||
this.parse_series = "";
|
||||
this.parse_season = null;
|
||||
this.parse_episode = null;
|
||||
this.parse_title = "";
|
||||
this.selectedFiles = _value.files
|
||||
@ -309,7 +309,7 @@ export class UploadScene implements OnInit {
|
||||
this.parse_title = splitElement[0];
|
||||
} else {
|
||||
if (splitElement.length>=2) {
|
||||
this.parse_serie = splitElement[0];
|
||||
this.parse_series = splitElement[0];
|
||||
}
|
||||
splitElement.splice(0,1);
|
||||
if (splitElement.length == 1) {
|
||||
@ -318,10 +318,10 @@ export class UploadScene implements OnInit {
|
||||
while (splitElement.length>0) {
|
||||
let element = splitElement[0];
|
||||
let find = false;
|
||||
if (this.parse_saison == null) {
|
||||
if (this.parse_season == null) {
|
||||
if (element.length >= 1 && (element[0] == 's' || element[0] == 'S') ) {
|
||||
element = element.substring(1);
|
||||
this.parse_saison = parseInt(element, 10);
|
||||
this.parse_season = parseInt(element, 10);
|
||||
find = true;
|
||||
}
|
||||
}
|
||||
@ -333,7 +333,7 @@ export class UploadScene implements OnInit {
|
||||
}
|
||||
}
|
||||
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 == "") {
|
||||
this.parse_universe = element;
|
||||
} else {
|
||||
@ -357,11 +357,11 @@ export class UploadScene implements OnInit {
|
||||
this.updateNeedSend();
|
||||
|
||||
let self = this;
|
||||
if (this.parse_serie != "") {
|
||||
this.groupService.getLike(this.parse_serie)
|
||||
if (this.parse_series != "") {
|
||||
this.seriesService.getLike(this.parse_series)
|
||||
.then(function(response) {
|
||||
console.log("find elemet: " + response.name + " " + response.id);
|
||||
self.serie_id = response.id;
|
||||
self.series_id = response.id;
|
||||
}).catch(function(response) {
|
||||
console.log("CAN NOT find element: " );
|
||||
});
|
||||
@ -378,34 +378,34 @@ export class UploadScene implements OnInit {
|
||||
let self = this;
|
||||
|
||||
/*
|
||||
this.parse_serie = "";
|
||||
this.parse_saison = null;
|
||||
this.parse_series = "";
|
||||
this.parse_season = null;
|
||||
this.parse_episode = null;
|
||||
this.parse_title = "";
|
||||
*/
|
||||
// clean uopload labels
|
||||
// clean upload labels
|
||||
this.uploadMediaSendSize = 0;
|
||||
this.uploadMediaSize = 0;
|
||||
this.uploadLabelMediaTitle = "";
|
||||
this.uploadResult = null;
|
||||
this.uploadError = null;
|
||||
// add univers
|
||||
// add universe
|
||||
if (this.parse_universe != null) {
|
||||
this.uploadLabelMediaTitle += this.parse_universe;
|
||||
}
|
||||
// add serie
|
||||
if (this.parse_serie != null) {
|
||||
// add series
|
||||
if (this.parse_series != null) {
|
||||
if (this.uploadLabelMediaTitle.length != 0) {
|
||||
this.uploadLabelMediaTitle += "/";
|
||||
}
|
||||
this.uploadLabelMediaTitle += this.parse_serie;
|
||||
this.uploadLabelMediaTitle += this.parse_series;
|
||||
}
|
||||
// add saison
|
||||
if (this.parse_saison != null) {
|
||||
// add season
|
||||
if (this.parse_season != null) {
|
||||
if (this.uploadLabelMediaTitle.length != 0) {
|
||||
this.uploadLabelMediaTitle += "-";
|
||||
}
|
||||
this.uploadLabelMediaTitle += "s" + this.parse_saison.toString();
|
||||
this.uploadLabelMediaTitle += "s" + this.parse_season.toString();
|
||||
}
|
||||
// add episode ID
|
||||
if (this.parse_episode != null) {
|
||||
@ -423,8 +423,8 @@ export class UploadScene implements OnInit {
|
||||
this.popInService.open("popin-upload-progress");
|
||||
this.videoService.uploadFile(_file,
|
||||
this.parse_universe,
|
||||
this.parse_serie,
|
||||
this.parse_saison,
|
||||
this.parse_series,
|
||||
this.parse_season,
|
||||
this.parse_episode,
|
||||
this.parse_title,
|
||||
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);
|
||||
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);
|
||||
this.popInService.close("popin-new-serie");
|
||||
this.popInService.close("popin-new-series");
|
||||
}
|
||||
eventPopUpType (_event: string): void {
|
||||
console.log("GET event: " + _event);
|
||||
this.popInService.close("popin-new-type");
|
||||
}
|
||||
eventPopUpUnivers (_event: string): void {
|
||||
eventPopUpUniverse (_event: string): void {
|
||||
console.log("GET event: " + _event);
|
||||
this.popInService.close("popin-new-univers");
|
||||
this.popInService.close("popin-new-universe");
|
||||
}
|
||||
|
||||
newSaison (): void {
|
||||
console.log("Request new Saison...");
|
||||
this.popInService.open("popin-new-saison");
|
||||
newSeason (): void {
|
||||
console.log("Request new Season...");
|
||||
this.popInService.open("popin-new-season");
|
||||
}
|
||||
newSerie (): void {
|
||||
console.log("Request new Serie...");
|
||||
this.popInService.open("popin-new-serie");
|
||||
newSeries (): void {
|
||||
console.log("Request new Series...");
|
||||
this.popInService.open("popin-new-series");
|
||||
}
|
||||
newType (): void {
|
||||
console.log("Request new Type...");
|
||||
this.popInService.open("popin-create-type");
|
||||
}
|
||||
newUnivers () {
|
||||
console.log("Request new Univers...");
|
||||
this.popInService.open("popin-new-univers");
|
||||
newUniverse () {
|
||||
console.log("Request new Universe...");
|
||||
this.popInService.open("popin-new-universe");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import { ArianeService } from '../../service/ariane';
|
||||
templateUrl: './validate-email.html',
|
||||
styleUrls: ['./validate-email.less']
|
||||
})
|
||||
export class ValidateEmailComponent implements OnInit {
|
||||
export class ValidateEmailScene implements OnInit {
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private arianeService: ArianeService
|
||||
|
@ -57,48 +57,48 @@
|
||||
</div>
|
||||
<div class="request_raw">
|
||||
<div class="label">
|
||||
Univers:
|
||||
Universe:
|
||||
</div>
|
||||
<div class="input">
|
||||
<select [ngModel]="data.univers_id"
|
||||
(ngModelChange)="onChangeUnivers($event)">
|
||||
<option *ngFor="let element of listUnivers" [ngValue]="element.value">{{element.label}}</option>
|
||||
<select [ngModel]="data.universe_id"
|
||||
(ngModelChange)="onChangeUniverse($event)">
|
||||
<option *ngFor="let element of listUniverse" [ngValue]="element.value">{{element.label}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="request_raw">
|
||||
<div class="label">
|
||||
Serie:
|
||||
Series:
|
||||
</div>
|
||||
<div class="input">
|
||||
<select [ngModel]="data.serie_id"
|
||||
(ngModelChange)="onChangeGroup($event)">
|
||||
<option *ngFor="let element of listGroup" [ngValue]="element.value">{{element.label}}</option>
|
||||
<select [ngModel]="data.series_id"
|
||||
(ngModelChange)="onChangeSeries($event)">
|
||||
<option *ngFor="let element of listSeries" [ngValue]="element.value">{{element.label}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="request_raw">
|
||||
<div class="label">
|
||||
Saison:
|
||||
Season:
|
||||
</div>
|
||||
<div class="input">
|
||||
<select [ngModel]="data.saison_id"
|
||||
(ngModelChange)="onChangeSaison($event)">
|
||||
<option *ngFor="let element of listSaison" [ngValue]="element.value">{{element.label}}</option>
|
||||
<select [ngModel]="data.season_id"
|
||||
(ngModelChange)="onChangeSeason($event)">
|
||||
<option *ngFor="let element of listSeason" [ngValue]="element.value">{{element.label}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
@ -170,38 +170,46 @@
|
||||
|
||||
<create-type ></create-type>
|
||||
|
||||
<popin id="popin-new-saison"
|
||||
popTitle="Create a new saison"
|
||||
<upload-progress [mediaTitle]="uploadLabelMediaTitle"
|
||||
[mediaUploaded]="uploadMediaSendSize"
|
||||
[mediaSize]="uploadMediaSize"
|
||||
[result]="uploadResult"
|
||||
[error]="uploadError"></upload-progress>
|
||||
|
||||
|
||||
<popin id="popin-new-season"
|
||||
popTitle="Create a new season"
|
||||
closeTopRight="true"
|
||||
closeTitle="Cancel"
|
||||
validateTitle="Create"
|
||||
(callback)="eventPopUpSaison($event[0])">
|
||||
(callback)="eventPopUpSeason($event[0])">
|
||||
<p>
|
||||
Name: <!-- <input type="text" [(ngModel)]="bodyText" /> -->
|
||||
</p>
|
||||
</popin>
|
||||
|
||||
<popin id="popin-new-serie"
|
||||
<popin id="popin-new-series"
|
||||
popSize="small"
|
||||
popTitle="Create a new serie"
|
||||
popTitle="Create a new series"
|
||||
closeTopRight="true"
|
||||
closeTitle="Cancel"
|
||||
validateTitle="Create"
|
||||
(callback)="eventPopUpSerie($event[0])">
|
||||
(callback)="eventPopUpSeries($event[0])">
|
||||
<p>
|
||||
Name: <!-- <input type="text" [(ngModel)]="bodyText" /> -->
|
||||
</p>
|
||||
</popin>
|
||||
|
||||
|
||||
<popin id="popin-new-univers"
|
||||
<popin id="popin-new-universe"
|
||||
popSize="big"
|
||||
popTitle="Create a new univers"
|
||||
popTitle="Create a new universe"
|
||||
closeTopRight="true"
|
||||
closeTitle="Cancel"
|
||||
validateTitle="Create"
|
||||
(callback)="eventPopUpUnivers($event[0])">
|
||||
(callback)="eventPopUpUniverse($event[0])">
|
||||
<p>
|
||||
Name: <!-- <input type="text" [(ngModel)]="bodyText" /> -->
|
||||
</p>
|
||||
</popin>
|
||||
|
||||
|
@ -16,8 +16,9 @@ import { HttpEventType, HttpResponse} from '@angular/common/http';
|
||||
|
||||
import { PopInService } from '../../service/popin';
|
||||
import { TypeService } from '../../service/type';
|
||||
import { UniversService } from '../../service/univers';
|
||||
import { GroupService } from '../../service/group';
|
||||
import { UniverseService } from '../../service/universe';
|
||||
import { SeriesService } from '../../service/series';
|
||||
import { SeasonService } from '../../service/season';
|
||||
import { VideoService } from '../../service/video';
|
||||
import { DataService } from '../../service/data';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
@ -36,12 +37,12 @@ class DataToSend {
|
||||
name:string = ""
|
||||
description:string = ""
|
||||
episode:number = undefined
|
||||
univers_id:number = undefined
|
||||
serie_id:number = undefined
|
||||
saison_id:number = undefined
|
||||
universe_id:number = null
|
||||
series_id:number = null
|
||||
season_id:number = null
|
||||
data_id:number = -1
|
||||
time:number = undefined
|
||||
type_id:number = undefined
|
||||
type_id:number = null
|
||||
covers:Array<any> = [];
|
||||
generated_name:string = ""
|
||||
clone() {
|
||||
@ -49,9 +50,9 @@ class DataToSend {
|
||||
tmp.name = this.name
|
||||
tmp.description = this.description
|
||||
tmp.episode = this.episode
|
||||
tmp.univers_id = this.univers_id
|
||||
tmp.serie_id = this.serie_id
|
||||
tmp.saison_id = this.saison_id
|
||||
tmp.universe_id = this.universe_id
|
||||
tmp.series_id = this.series_id
|
||||
tmp.season_id = this.season_id
|
||||
tmp.data_id = this.data_id
|
||||
tmp.time = this.time
|
||||
tmp.type_id = this.type_id
|
||||
@ -69,7 +70,7 @@ class DataToSend {
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
// https://www.sitepoint.com/angular-forms/
|
||||
export class VideoEditComponent implements OnInit {
|
||||
export class VideoEditScene implements OnInit {
|
||||
id_video:number = -1;
|
||||
|
||||
error:string = ""
|
||||
@ -81,19 +82,28 @@ export class VideoEditComponent implements OnInit {
|
||||
selectedFiles:FileList;
|
||||
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> = [];
|
||||
|
||||
listType: ElementList[] = [
|
||||
{value: undefined, label: '---'},
|
||||
];
|
||||
listUnivers: ElementList[] = [
|
||||
listUniverse: ElementList[] = [
|
||||
{value: undefined, label: '---'},
|
||||
{value: null, label: '---'},
|
||||
];
|
||||
listGroup: ElementList[] = [
|
||||
listSeries: ElementList[] = [
|
||||
{value: undefined, label: '---'},
|
||||
];
|
||||
listSaison: ElementList[] = [
|
||||
listSeason: ElementList[] = [
|
||||
{value: undefined, label: '---'},
|
||||
];
|
||||
constructor(private route: ActivatedRoute,
|
||||
@ -101,8 +111,9 @@ export class VideoEditComponent implements OnInit {
|
||||
private locate: Location,
|
||||
private dataService: DataService,
|
||||
private typeService: TypeService,
|
||||
private universService: UniversService,
|
||||
private groupService: GroupService,
|
||||
private universeService: UniverseService,
|
||||
private seriesService: SeriesService,
|
||||
private seasonService: SeasonService,
|
||||
private videoService: VideoService,
|
||||
private httpService: HttpWrapperService,
|
||||
private arianeService: ArianeService,
|
||||
@ -127,30 +138,45 @@ export class VideoEditComponent implements OnInit {
|
||||
if (this.data.type_id != this.data_ori.type_id) {
|
||||
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;
|
||||
}
|
||||
if (this.data.serie_id != this.data_ori.serie_id) {
|
||||
if (this.data.series_id != this.data_ori.series_id) {
|
||||
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;
|
||||
}
|
||||
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() {
|
||||
this.arianeService.updateManual(this.route.snapshot.paramMap);
|
||||
this.id_video = this.arianeService.getVideoId();
|
||||
let self = this;
|
||||
this.listType = [{value: undefined, label: '---'}];
|
||||
this.listUnivers = [{value: undefined, label: '---'}];
|
||||
this.listGroup = [{value: undefined, label: '---'}];
|
||||
this.listSaison = [{value: undefined, label: '---'}];
|
||||
this.universService.getData()
|
||||
this.listType = [{value: null, label: '---'}];
|
||||
this.listUniverse = [{value: null, label: '---'}];
|
||||
this.listSeries = [{value: null, label: '---'}];
|
||||
this.listSeason = [{value: null, label: '---'}];
|
||||
this.universeService.getData()
|
||||
.then(function(response2) {
|
||||
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) {
|
||||
console.log("get response22 : " + JSON.stringify(response2, null, 2));
|
||||
@ -163,12 +189,12 @@ export class VideoEditComponent implements OnInit {
|
||||
}).catch(function(response2) {
|
||||
console.log("get response22 : " + JSON.stringify(response2, null, 2));
|
||||
});
|
||||
//this.groupService.getOrder()
|
||||
this.groupService.getData()
|
||||
//this.seriesService.getOrder()
|
||||
this.seriesService.getData()
|
||||
.then(function(response3) {
|
||||
for(let iii= 0; iii < response3.length; iii++) {
|
||||
self.listGroup.push({value: response3[iii].id, label: response3[iii].name});
|
||||
console.log("[" + self.data.data_id + "] Get serie: " + 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 series: " + response3[iii].id + ", label:" + response3[iii].name)
|
||||
}
|
||||
}).catch(function(response3) {
|
||||
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.description = response.description;
|
||||
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.time = response.time;
|
||||
self.data.generated_name = response.generated_name;
|
||||
self.onChangeType(response.type_id);
|
||||
self.onChangeGroup(response.serie_id);
|
||||
self.data.saison_id = response.saison_id;
|
||||
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 = []
|
||||
if (self.data.type_id === undefined) {
|
||||
self.data.type_id = null;
|
||||
}
|
||||
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();
|
||||
console.log("covers_list : " + JSON.stringify(self.covers_display, null, 2));
|
||||
}).catch(function(response) {
|
||||
@ -212,18 +240,18 @@ export class VideoEditComponent implements OnInit {
|
||||
onChangeType(_value:any):void {
|
||||
console.log("Change requested of type ... " + _value);
|
||||
this.data.type_id = _value;
|
||||
//this.data.serie_id = null;
|
||||
//this.data.saison_id = null;
|
||||
//this.listGroup = [{value: undefined, label: '---'}];
|
||||
//this.listSaison = [{value: undefined, label: '---'}];
|
||||
//this.data.series_id = null;
|
||||
//this.data.season_id = null;
|
||||
//this.listSeries = [{value: undefined, label: '---'}];
|
||||
//this.listSeason = [{value: undefined, label: '---'}];
|
||||
let self = this;
|
||||
this.updateNeedSend();
|
||||
/*
|
||||
if (this.type_id != undefined) {
|
||||
self.typeService.getSubGroup(this.type_id, ["id", "name"])
|
||||
self.typeService.getSubSeries(this.type_id, ["id", "name"])
|
||||
.then(function(response2) {
|
||||
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) {
|
||||
console.log("get response22 : " + JSON.stringify(response2, null, 2));
|
||||
@ -232,21 +260,21 @@ export class VideoEditComponent implements OnInit {
|
||||
*/
|
||||
}
|
||||
|
||||
onChangeUnivers(_value:any):void {
|
||||
this.data.univers_id = _value;
|
||||
onChangeUniverse(_value:any):void {
|
||||
this.data.universe_id = _value;
|
||||
this.updateNeedSend();
|
||||
}
|
||||
|
||||
onChangeGroup(_value:any):void {
|
||||
this.data.serie_id = _value;
|
||||
this.data.saison_id = null;
|
||||
this.listSaison = [{value: undefined, label: '---'}];
|
||||
onChangeSeries(_value:any):void {
|
||||
this.data.series_id = _value;
|
||||
this.data.season_id = null;
|
||||
this.listSeason = [{value: undefined, label: '---'}];
|
||||
let self = this;
|
||||
if (this.data.serie_id != undefined) {
|
||||
self.groupService.getSaison(this.data.serie_id, ["id", "name"])
|
||||
if (this.data.series_id != undefined) {
|
||||
self.seriesService.getSeason(this.data.series_id, ["id", "name"])
|
||||
.then(function(response3) {
|
||||
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) {
|
||||
console.log("get response22 : " + JSON.stringify(response3, null, 2));
|
||||
@ -254,8 +282,8 @@ export class VideoEditComponent implements OnInit {
|
||||
}
|
||||
this.updateNeedSend();
|
||||
}
|
||||
onChangeSaison(_value:any):void {
|
||||
this.data.saison_id = _value;
|
||||
onChangeSeason(_value:any):void {
|
||||
this.data.season_id = _value;
|
||||
this.updateNeedSend();
|
||||
}
|
||||
|
||||
@ -278,6 +306,9 @@ export class VideoEditComponent implements OnInit {
|
||||
} else {
|
||||
this.data.time = _value.value;
|
||||
}
|
||||
if (this.data.time < 10) {
|
||||
this.data.time = null;
|
||||
}
|
||||
this.updateNeedSend();
|
||||
}
|
||||
|
||||
@ -306,16 +337,32 @@ export class VideoEditComponent implements OnInit {
|
||||
data["time"] = this.data.time;
|
||||
}
|
||||
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) {
|
||||
data["univers_id"] = this.data.univers_id;
|
||||
if (this.data.universe_id != this.data_ori.universe_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) {
|
||||
data["serie_id"] = this.data.serie_id;
|
||||
if (this.data.series_id != this.data_ori.series_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) {
|
||||
data["saison_id"] = this.data.saison_id;
|
||||
if (this.data.season_id != this.data_ori.season_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 self = this;
|
||||
@ -333,7 +380,8 @@ export class VideoEditComponent implements OnInit {
|
||||
// (drop)="onDropFile($event)"
|
||||
onDropFile(_event: DragEvent) {
|
||||
_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
|
||||
@ -349,34 +397,53 @@ export class VideoEditComponent implements OnInit {
|
||||
this.selectedFiles = _value.files
|
||||
this.coverFile = this.selectedFiles[0];
|
||||
console.log("select file " + this.coverFile.name);
|
||||
this.uploadFile(this.coverFile);
|
||||
this.uploadCover(this.coverFile);
|
||||
this.updateNeedSend();
|
||||
}
|
||||
|
||||
uploadFile(_file:File) {
|
||||
uploadCover(_file:File) {
|
||||
if (_file == undefined) {
|
||||
console.log("No file selected!");
|
||||
return;
|
||||
}
|
||||
let self = this;
|
||||
this.dataService.sendFile(_file)
|
||||
.then(function(response) {
|
||||
console.log("get response of video : " + JSON.stringify(response, null, 2));
|
||||
let id_of_image = response.id;
|
||||
self.videoService.addCover(self.id_video, id_of_image)
|
||||
.then(function(response) {
|
||||
console.log("cover added");
|
||||
self.covers_display.push(self.videoService.getCoverUrl(id_of_image));
|
||||
}).catch(function(response) {
|
||||
console.log("Can not cover in the cover_list...");
|
||||
});
|
||||
}).catch(function(response) {
|
||||
//self.error = "Can not get the data";
|
||||
console.log("Can not add the data in the system...");
|
||||
});
|
||||
// clean upload labels
|
||||
this.uploadMediaSendSize = 0;
|
||||
this.uploadMediaSize = 0;
|
||||
this.uploadLabelMediaTitle = "";
|
||||
this.uploadResult = null;
|
||||
this.uploadError = null;
|
||||
// display the upload pop-in
|
||||
this.popInService.open("popin-upload-progress");
|
||||
this.videoService.uploadCover(_file, this.id_video, function(count, total) {
|
||||
self.uploadMediaSendSize = count;
|
||||
self.uploadMediaSize = total;
|
||||
})
|
||||
.then(function (response:any) {
|
||||
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);
|
||||
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() {
|
||||
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);
|
||||
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);
|
||||
this.popInService.close("popin-new-serie");
|
||||
this.popInService.close("popin-new-series");
|
||||
}
|
||||
eventPopUpType(_event: string): void {
|
||||
console.log("GET event: " + _event);
|
||||
this.popInService.close("popin-new-type");
|
||||
}
|
||||
eventPopUpUnivers(_event: string): void {
|
||||
eventPopUpUniverse(_event: string): void {
|
||||
console.log("GET event: " + _event);
|
||||
this.popInService.close("popin-new-univers");
|
||||
this.popInService.close("popin-new-universe");
|
||||
}
|
||||
|
||||
newSaison(): void {
|
||||
console.log("Request new Saison...");
|
||||
this.popInService.open("popin-new-saison");
|
||||
newSeason(): void {
|
||||
console.log("Request new Season...");
|
||||
this.popInService.open("popin-new-season");
|
||||
}
|
||||
newSerie(): void {
|
||||
console.log("Request new Serie...");
|
||||
this.popInService.open("popin-new-serie");
|
||||
newSeries(): void {
|
||||
console.log("Request new Series...");
|
||||
this.popInService.open("popin-new-series");
|
||||
}
|
||||
newType(): void {
|
||||
console.log("Request new Type...");
|
||||
this.popInService.open("popin-create-type");
|
||||
}
|
||||
newUnivers() {
|
||||
console.log("Request new Univers...");
|
||||
this.popInService.open("popin-new-univers");
|
||||
newUniverse() {
|
||||
console.log("Request new Universe...");
|
||||
this.popInService.open("popin-new-universe");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
<div class="cover" *ngIf="cover != null" >
|
||||
<img src="{{cover}}"/>
|
||||
</div>
|
||||
<div class="episode" *ngIf="group_name!=null">
|
||||
<b>Serie:</b> {{group_name}}
|
||||
<div class="episode" *ngIf="series_name!=null">
|
||||
<b>Series:</b> {{series_name}}
|
||||
</div>
|
||||
<div class="episode" *ngIf="saison_name!=null">
|
||||
<b>Saison:</b> {{saison_name}}
|
||||
<div class="episode" *ngIf="season_name!=null">
|
||||
<b>Season:</b> {{season_name}}
|
||||
</div>
|
||||
<div class="episode" *ngIf="episode!=null">
|
||||
<b>Episode:</b> {{episode}}
|
||||
|
@ -10,8 +10,8 @@ import { Location } from '@angular/common';
|
||||
import { fadeInAnimation } from '../../_animations/index';
|
||||
import { HttpWrapperService } from '../../service/http-wrapper';
|
||||
import { VideoService } from '../../service/video';
|
||||
import { GroupService } from '../../service/group';
|
||||
import { SaisonService } from '../../service/saison';
|
||||
import { SeriesService } from '../../service/series';
|
||||
import { SeasonService } from '../../service/season';
|
||||
import { ArianeService } from '../../service/ariane';
|
||||
|
||||
@Component({
|
||||
@ -22,7 +22,7 @@ import { ArianeService } from '../../service/ariane';
|
||||
host: { '[@fadeInAnimation]': '' }
|
||||
})
|
||||
|
||||
export class VideoComponent implements OnInit {
|
||||
export class VideoScene implements OnInit {
|
||||
id_video:number = -1;
|
||||
|
||||
error:string = ""
|
||||
@ -30,10 +30,10 @@ export class VideoComponent implements OnInit {
|
||||
name:string = ""
|
||||
description:string = ""
|
||||
episode:number = undefined
|
||||
group_id:number = undefined
|
||||
group_name:string = undefined
|
||||
saison_id:number = undefined
|
||||
saison_name:string = undefined
|
||||
series_id:number = undefined
|
||||
series_name:string = undefined
|
||||
season_id:number = undefined
|
||||
season_name:string = undefined
|
||||
data_id:number = -1
|
||||
time:number = undefined
|
||||
type_id:number = undefined
|
||||
@ -46,8 +46,8 @@ export class VideoComponent implements OnInit {
|
||||
private router: Router,
|
||||
private locate: Location,
|
||||
private videoService: VideoService,
|
||||
private groupService: GroupService,
|
||||
private saisonService: SaisonService,
|
||||
private seriesService: SeriesService,
|
||||
private seasonService: SeasonService,
|
||||
private httpService: HttpWrapperService,
|
||||
private arianeService: ArianeService) {
|
||||
|
||||
@ -55,14 +55,14 @@ export class VideoComponent implements OnInit {
|
||||
|
||||
generateName() {
|
||||
this.generated_name = "";
|
||||
if (this.group_name != undefined) {
|
||||
this.generated_name += this.group_name + "-";
|
||||
if (this.series_name != undefined) {
|
||||
this.generated_name += this.series_name + "-";
|
||||
}
|
||||
if (this.saison_name != undefined) {
|
||||
if (this.saison_name.length < 2) {
|
||||
this.generated_name += "s0" + this.saison_name + "-";
|
||||
if (this.season_name != undefined) {
|
||||
if (this.season_name.length < 2) {
|
||||
this.generated_name += "s0" + this.season_name + "-";
|
||||
} else {
|
||||
this.generated_name += "s" + this.saison_name + "-";
|
||||
this.generated_name += "s" + this.season_name + "-";
|
||||
}
|
||||
}
|
||||
if (this.episode != undefined) {
|
||||
@ -87,8 +87,8 @@ export class VideoComponent implements OnInit {
|
||||
self.name = response.name;
|
||||
self.description = response.description;
|
||||
self.episode = response.episode;
|
||||
self.group_id = response.serie_id;
|
||||
self.saison_id = response.saison_id;
|
||||
self.series_id = response.series_id;
|
||||
self.season_id = response.season_id;
|
||||
self.data_id = response.data_id;
|
||||
self.time = response.time;
|
||||
self.generated_name = response.generated_name;
|
||||
@ -106,19 +106,19 @@ export class VideoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
self.generateName();
|
||||
if (self.group_id !== undefined && self.group_id !== null) {
|
||||
self.groupService.get(self.group_id)
|
||||
if (self.series_id !== undefined && self.series_id !== null) {
|
||||
self.seriesService.get(self.series_id)
|
||||
.then(function(response) {
|
||||
self.group_name = response.name;
|
||||
self.series_name = response.name;
|
||||
self.generateName();
|
||||
}).catch(function(response) {
|
||||
// nothing to do ...
|
||||
});
|
||||
}
|
||||
if (self.saison_id !== undefined && self.saison_id !== null) {
|
||||
self.saisonService.get(self.saison_id)
|
||||
if (self.season_id !== undefined && self.season_id !== null) {
|
||||
self.seasonService.get(self.season_id)
|
||||
.then(function(response) {
|
||||
self.saison_name = response.name;
|
||||
self.season_name = response.name;
|
||||
self.generateName();
|
||||
}).catch(function(response) {
|
||||
// nothing to do ...
|
||||
@ -131,15 +131,15 @@ export class VideoComponent implements OnInit {
|
||||
self.name = "";
|
||||
self.description = "";
|
||||
self.episode = undefined;
|
||||
self.group_id = undefined;
|
||||
self.saison_id = undefined;
|
||||
self.series_id = undefined;
|
||||
self.season_id = undefined;
|
||||
self.data_id = -1;
|
||||
self.time = undefined;
|
||||
self.generated_name = "";
|
||||
self.video_source = "";
|
||||
self.cover = null;
|
||||
self.group_name = undefined;
|
||||
self.saison_name = undefined;
|
||||
self.series_name = undefined;
|
||||
self.season_name = undefined;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -8,18 +8,18 @@ import { Injectable, Output, EventEmitter, OnInit} from '@angular/core'
|
||||
|
||||
import { Router, ActivatedRoute, ParamMap, NavigationEnd } from '@angular/router';
|
||||
|
||||
import { TypeService } from 'app/service/type';
|
||||
import { UniversService } from 'app/service/univers';
|
||||
import { GroupService } from 'app/service/group';
|
||||
import { SaisonService } from 'app/service/saison';
|
||||
import { VideoService } from 'app/service/video';
|
||||
import { environment } from 'environments/environment';
|
||||
import { TypeService } from './type';
|
||||
import { UniverseService } from './universe';
|
||||
import { SeriesService } from './series';
|
||||
import { SeasonService } from './season';
|
||||
import { VideoService } from './video';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
export class InputOrders {
|
||||
public type_id: number = null;
|
||||
public univers_id: number = null;
|
||||
public group_id: number = null;
|
||||
public saison_id: number = null;
|
||||
public universe_id: number = null;
|
||||
public series_id: number = null;
|
||||
public season_id: number = null;
|
||||
public video_id: number = null;
|
||||
}
|
||||
|
||||
@ -31,17 +31,17 @@ export class ArianeService {
|
||||
public type_name: string = null;
|
||||
@Output() type_change: EventEmitter<number> = new EventEmitter();
|
||||
|
||||
public univers_id: number = null;
|
||||
public univers_name: string = null;
|
||||
@Output() univers_change: EventEmitter<number> = new EventEmitter();
|
||||
public universe_id: number = null;
|
||||
public universe_name: string = null;
|
||||
@Output() universe_change: EventEmitter<number> = new EventEmitter();
|
||||
|
||||
public group_id: number = null;
|
||||
public group_name: string = null;
|
||||
@Output() group_change: EventEmitter<number> = new EventEmitter();
|
||||
public series_id: number = null;
|
||||
public series_name: string = null;
|
||||
@Output() series_change: EventEmitter<number> = new EventEmitter();
|
||||
|
||||
public saison_id: number = null;
|
||||
public saison_name: string = null;
|
||||
@Output() saison_change: EventEmitter<number> = new EventEmitter();
|
||||
public season_id: number = null;
|
||||
public season_name: string = null;
|
||||
@Output() season_change: EventEmitter<number> = new EventEmitter();
|
||||
|
||||
public video_id: number = null;
|
||||
public video_name: string = null;
|
||||
@ -50,9 +50,9 @@ export class ArianeService {
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private typeService: TypeService,
|
||||
private universService: UniversService,
|
||||
private groupService: GroupService,
|
||||
private saisonService: SaisonService,
|
||||
private universeService: UniverseService,
|
||||
private seriesService: SeriesService,
|
||||
private seasonService: SeasonService,
|
||||
private videoService: VideoService) {
|
||||
console.log("Start ArianeService");
|
||||
}
|
||||
@ -75,29 +75,29 @@ export class ArianeService {
|
||||
}
|
||||
console.log("type_id = " + type_id + " " + params.get('type_id'));
|
||||
|
||||
let univers_id = params.get('univers_id');
|
||||
if (univers_id === null || univers_id === undefined || univers_id == "null" || univers_id == "NULL" || univers_id == "") {
|
||||
univers_id = null;
|
||||
let universe_id = params.get('universe_id');
|
||||
if (universe_id === null || universe_id === undefined || universe_id == "null" || universe_id == "NULL" || universe_id == "") {
|
||||
universe_id = null;
|
||||
} 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');
|
||||
if (group_id === null || group_id === undefined || group_id == "null" || group_id == "NULL" || group_id == "") {
|
||||
group_id = null;
|
||||
let series_id = params.get('series_id');
|
||||
if (series_id === null || series_id === undefined || series_id == "null" || series_id == "NULL" || series_id == "") {
|
||||
series_id = null;
|
||||
} 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');
|
||||
if (saison_id === null || saison_id === undefined || saison_id == "null" || saison_id == "NULL" || saison_id == "") {
|
||||
saison_id = null;
|
||||
let season_id = params.get('season_id');
|
||||
if (season_id === null || season_id === undefined || season_id == "null" || season_id == "NULL" || season_id == "") {
|
||||
season_id = null;
|
||||
} 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');
|
||||
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'));
|
||||
|
||||
this.setType(type_id);
|
||||
this.setUnivers(univers_id);
|
||||
this.setGroup(group_id);
|
||||
this.setSaison(saison_id);
|
||||
this.setUniverse(universe_id);
|
||||
this.setSeries(series_id);
|
||||
this.setSeason(season_id);
|
||||
this.setVideo(video_id);
|
||||
}
|
||||
reset():void {
|
||||
this.type_id = null;
|
||||
this.type_name = null;
|
||||
this.type_change.emit(this.type_id);
|
||||
this.univers_id = null;
|
||||
this.univers_name = null;
|
||||
this.univers_change.emit(this.univers_id);
|
||||
this.group_id = null;
|
||||
this.group_name = null;
|
||||
this.group_change.emit(this.group_id);
|
||||
this.saison_id = null;
|
||||
this.saison_name = null;
|
||||
this.saison_change.emit(this.saison_id);
|
||||
this.universe_id = null;
|
||||
this.universe_name = null;
|
||||
this.universe_change.emit(this.universe_id);
|
||||
this.series_id = null;
|
||||
this.series_name = null;
|
||||
this.series_change.emit(this.series_id);
|
||||
this.season_id = null;
|
||||
this.season_name = null;
|
||||
this.season_change.emit(this.season_id);
|
||||
this.video_id = null;
|
||||
this.video_name = null;
|
||||
this.video_change.emit(this.video_id);
|
||||
@ -137,17 +137,17 @@ export class ArianeService {
|
||||
if (out.type_id == 0){
|
||||
out.type_id = undefined;
|
||||
}
|
||||
out.univers_id = parseInt(this.route.snapshot.paramMap.get('univers_id'));
|
||||
if (out.univers_id == 0){
|
||||
out.univers_id = undefined;
|
||||
out.universe_id = parseInt(this.route.snapshot.paramMap.get('univers_id'));
|
||||
if (out.universe_id == 0){
|
||||
out.universe_id = undefined;
|
||||
}
|
||||
out.group_id = parseInt(this.route.snapshot.paramMap.get('group_id'));
|
||||
if (out.group_id == 0){
|
||||
out.group_id = undefined;
|
||||
out.series_id = parseInt(this.route.snapshot.paramMap.get('series_id'));
|
||||
if (out.series_id == 0){
|
||||
out.series_id = undefined;
|
||||
}
|
||||
out.saison_id = parseInt(this.route.snapshot.paramMap.get('saison_id'));
|
||||
if (out.saison_id == 0){
|
||||
out.saison_id = undefined;
|
||||
out.season_id = parseInt(this.route.snapshot.paramMap.get('season_id'));
|
||||
if (out.season_id == 0){
|
||||
out.season_id = undefined;
|
||||
}
|
||||
out.video_id = parseInt(this.route.snapshot.paramMap.get('video_id'));
|
||||
if (out.video_id == 0){
|
||||
@ -159,7 +159,7 @@ export class ArianeService {
|
||||
routeTo(_data:InputOrders, _destination:string = null) {
|
||||
routeTo = ""
|
||||
//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;
|
||||
}
|
||||
|
||||
setUnivers(_id:number) {
|
||||
if (this.univers_id == _id) {
|
||||
setUniverse(_id:number) {
|
||||
if (this.universe_id == _id) {
|
||||
return;
|
||||
}
|
||||
if (_id === undefined) {
|
||||
return;
|
||||
}
|
||||
this.univers_id = _id;
|
||||
this.univers_name = "??--??";
|
||||
if (this.univers_id === null) {
|
||||
this.univers_change.emit(this.univers_id);
|
||||
this.universe_id = _id;
|
||||
this.universe_name = "??--??";
|
||||
if (this.universe_id === null) {
|
||||
this.universe_change.emit(this.universe_id);
|
||||
return;
|
||||
}
|
||||
let self = this;
|
||||
this.universService.get(_id)
|
||||
this.universeService.get(_id)
|
||||
.then(function(response) {
|
||||
self.univers_name = response.number
|
||||
self.univers_change.emit(self.univers_id);
|
||||
self.universe_name = response.number
|
||||
self.universe_change.emit(self.universe_id);
|
||||
}).catch(function(response) {
|
||||
self.univers_change.emit(self.univers_id);
|
||||
self.universe_change.emit(self.universe_id);
|
||||
});
|
||||
}
|
||||
getUniversId():number {
|
||||
return this.univers_id;
|
||||
getUniverseId():number {
|
||||
return this.universe_id;
|
||||
}
|
||||
getUniversName():string {
|
||||
return this.univers_name;
|
||||
getUniverseName():string {
|
||||
return this.universe_name;
|
||||
}
|
||||
|
||||
setGroup(_id:number):void {
|
||||
if (this.group_id == _id) {
|
||||
setSeries(_id:number):void {
|
||||
if (this.series_id == _id) {
|
||||
return;
|
||||
}
|
||||
if (_id === undefined) {
|
||||
return;
|
||||
}
|
||||
this.group_id = _id;
|
||||
this.group_name = "??--??";
|
||||
if (this.group_id === null) {
|
||||
this.group_change.emit(this.group_id);
|
||||
this.series_id = _id;
|
||||
this.series_name = "??--??";
|
||||
if (this.series_id === null) {
|
||||
this.series_change.emit(this.series_id);
|
||||
return;
|
||||
}
|
||||
let self = this;
|
||||
this.groupService.get(_id)
|
||||
this.seriesService.get(_id)
|
||||
.then(function(response) {
|
||||
self.group_name = response.name
|
||||
self.group_change.emit(self.group_id);
|
||||
self.series_name = response.name
|
||||
self.series_change.emit(self.series_id);
|
||||
}).catch(function(response) {
|
||||
self.group_change.emit(self.group_id);
|
||||
self.series_change.emit(self.series_id);
|
||||
});
|
||||
}
|
||||
getGroupId():number {
|
||||
return this.group_id;
|
||||
getSeriesId():number {
|
||||
return this.series_id;
|
||||
}
|
||||
getGroupName():string {
|
||||
return this.group_name;
|
||||
getSeriesName():string {
|
||||
return this.series_name;
|
||||
}
|
||||
|
||||
setSaison(_id:number):void {
|
||||
if (this.saison_id == _id) {
|
||||
setSeason(_id:number):void {
|
||||
if (this.season_id == _id) {
|
||||
return;
|
||||
}
|
||||
if (_id === undefined) {
|
||||
return;
|
||||
}
|
||||
this.saison_id = _id;
|
||||
this.saison_name = "??--??";
|
||||
if (this.saison_id === null) {
|
||||
this.saison_change.emit(this.saison_id);
|
||||
this.season_id = _id;
|
||||
this.season_name = "??--??";
|
||||
if (this.season_id === null) {
|
||||
this.season_change.emit(this.season_id);
|
||||
return;
|
||||
}
|
||||
let self = this;
|
||||
this.saisonService.get(_id)
|
||||
this.seasonService.get(_id)
|
||||
.then(function(response) {
|
||||
//self.setGroup(response.group_id);
|
||||
self.saison_name = response.name
|
||||
self.saison_change.emit(self.saison_id);
|
||||
//self.setSeries(response.series_id);
|
||||
self.season_name = response.name
|
||||
self.season_change.emit(self.season_id);
|
||||
}).catch(function(response) {
|
||||
self.saison_change.emit(self.saison_id);
|
||||
self.season_change.emit(self.season_id);
|
||||
});
|
||||
}
|
||||
getSaisonId():number {
|
||||
return this.saison_id;
|
||||
getSeasonId():number {
|
||||
return this.season_id;
|
||||
}
|
||||
getSaisonName():string {
|
||||
return this.saison_name;
|
||||
getSeasonName():string {
|
||||
return this.season_name;
|
||||
}
|
||||
|
||||
setVideo(_id:number):void {
|
||||
@ -296,8 +296,8 @@ export class ArianeService {
|
||||
let self = this;
|
||||
this.videoService.get(_id)
|
||||
.then(function(response) {
|
||||
//self.setSaison(response.saison_id);
|
||||
//self.setGroup(response.group_id);
|
||||
//self.setSeason(response.season_id);
|
||||
//self.setSeries(response.series_id);
|
||||
self.video_name = response.name;
|
||||
self.video_change.emit(self.video_id);
|
||||
}).catch(function(response) {
|
||||
@ -311,8 +311,8 @@ export class ArianeService {
|
||||
return this.video_name;
|
||||
}
|
||||
|
||||
genericNavigate(_destination:string, _universId:number, _typeId:number, _groupId:number, _saisonId:number, _videoId:number, _newWindows:boolean):void {
|
||||
let addressOffset = _destination + '/' + _universId + '/' + _typeId + '/' + _groupId + '/' + _saisonId + '/' + _videoId;
|
||||
genericNavigate(_destination:string, _universeId:number, _typeId:number, _seriesId:number, _seasonId:number, _videoId:number, _newWindows:boolean):void {
|
||||
let addressOffset = _destination + '/' + _universeId + '/' + _typeId + '/' + _seriesId + '/' + _seasonId + '/' + _videoId;
|
||||
if(_newWindows==true) {
|
||||
if (environment.frontBaseUrl === undefined || environment.frontBaseUrl === null || environment.frontBaseUrl === "") {
|
||||
window.open('/' + addressOffset);
|
||||
@ -324,35 +324,35 @@ export class ArianeService {
|
||||
}
|
||||
}
|
||||
|
||||
navigateUnivers(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('univers', _id, this.type_id, null, null, null, _newWindows);
|
||||
navigateUniverse(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('universe', _id, this.type_id, null, null, null, _newWindows);
|
||||
}
|
||||
navigateUniversEdit(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('univers-edit', _id, this.type_id, null, null, null, _newWindows);
|
||||
navigateUniverseEdit(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('universe-edit', _id, this.type_id, null, null, null, _newWindows);
|
||||
}
|
||||
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 {
|
||||
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 {
|
||||
this.genericNavigate('group', this.univers_id, this.type_id, _id, null, null, _newWindows);
|
||||
navigateSeries(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('series', this.universe_id, this.type_id, _id, null, null, _newWindows);
|
||||
}
|
||||
navigateGroupEdit(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('group-edit', this.univers_id, this.type_id, _id, null, null, _newWindows);
|
||||
navigateSeriesEdit(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('series-edit', this.universe_id, this.type_id, _id, null, null, _newWindows);
|
||||
}
|
||||
navigateSaison(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('saison', this.univers_id, this.type_id, this.group_id, _id, null, _newWindows);
|
||||
navigateSeason(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('season', this.universe_id, this.type_id, this.series_id, _id, null, _newWindows);
|
||||
}
|
||||
navigateSaisonEdit(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('saison-edit', this.univers_id, this.type_id, this.group_id, _id, null, _newWindows);
|
||||
navigateSeasonEdit(_id:number, _newWindows:boolean):void {
|
||||
this.genericNavigate('season-edit', this.universe_id, this.type_id, this.series_id, _id, null, _newWindows);
|
||||
}
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,23 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
import { DataInterface } from 'app/service/dataInterface';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from './dataInterface';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class BddService {
|
||||
private bdd = {
|
||||
"type": null,
|
||||
"group": null,
|
||||
"saison": null,
|
||||
"univers": null,
|
||||
"series": null,
|
||||
"season": null,
|
||||
"universe": null,
|
||||
"video": null
|
||||
};
|
||||
private bddPomise = {
|
||||
"type": null,
|
||||
"group": null,
|
||||
"saison": null,
|
||||
"univers": null,
|
||||
"series": null,
|
||||
"season": null,
|
||||
"universe": null,
|
||||
"video": null
|
||||
};
|
||||
|
||||
@ -30,9 +29,10 @@ export class BddService {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.get(_name)
|
||||
.then(function(response) {
|
||||
.then(function(response:DataInterface) {
|
||||
let responseTmp = response;
|
||||
ret.then(function(response2) {
|
||||
response.set(_id, response2);
|
||||
responseTmp.set(_id, response2);
|
||||
resolve(response2);
|
||||
}).catch(function(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) {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.get(_name)
|
||||
.then(function(response) {
|
||||
.then(function(response:DataInterface) {
|
||||
let responseTmp = response;
|
||||
ret.then(function(response2) {
|
||||
response.delete(_id);
|
||||
responseTmp.delete(_id);
|
||||
resolve(response2);
|
||||
}).catch(function(response2) {
|
||||
reject(response2);
|
||||
@ -62,8 +72,9 @@ export class BddService {
|
||||
|
||||
get(_name: string): any {
|
||||
let self = this;
|
||||
console.log("Try to get DB '" + _name + "'");
|
||||
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;
|
||||
}
|
||||
if (this.bdd[_name] !== null) {
|
||||
@ -101,24 +112,24 @@ export class BddService {
|
||||
});
|
||||
}
|
||||
|
||||
getType():any {
|
||||
getType():DataInterface {
|
||||
return this.get("type");
|
||||
};
|
||||
}
|
||||
|
||||
getGroup():any {
|
||||
return this.get("group");
|
||||
};
|
||||
getSeries():DataInterface {
|
||||
return this.get("series");
|
||||
}
|
||||
|
||||
getSaison():any {
|
||||
return this.get("saison");
|
||||
};
|
||||
getSeason():DataInterface {
|
||||
return this.get("season");
|
||||
}
|
||||
|
||||
getUnivers():any {
|
||||
return this.get("univers");
|
||||
};
|
||||
getUniverse():DataInterface {
|
||||
return this.get("universe");
|
||||
}
|
||||
|
||||
getVideo():any {
|
||||
getVideo():DataInterface {
|
||||
return this.get("video");
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
import { DataInterface } from 'app/service/dataInterface';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from './dataInterface';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class DataService {
|
||||
|
@ -248,13 +248,21 @@ export class DataInterface {
|
||||
}
|
||||
//console.log("order in list by : " + value_order);
|
||||
//out = sorted(out, key=lambda x{ x[value_order])
|
||||
out.sort(function (a, b) {
|
||||
//const name1 = t1.name.toLowerCase();
|
||||
//const name2 = t2.name.toLowerCase();
|
||||
if (value_order == "name") {
|
||||
out.sort(function (a, b) {
|
||||
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; }
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
if (_order.length > 1) {
|
||||
out_unclassable = this.order_by(out_unclassable, _order.slice(1));
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams, HttpRequest, HttpEvent} from '@ang
|
||||
import { catchError, map, tap } from 'rxjs/operators';
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class HttpOAuthWrapperService {
|
||||
@ -312,7 +312,7 @@ export class HttpOAuthWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// Complex wrapper to simplify interaction:
|
||||
delete_specific(_base:string, _id:number, _subElement:string = ""):any {
|
||||
@ -349,7 +349,7 @@ export class HttpOAuthWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
// Complex wrapper to simplify interaction:
|
||||
put_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
|
||||
//console.log("put data to " + _base);
|
||||
@ -385,7 +385,7 @@ export class HttpOAuthWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
// Complex wrapper to simplify interaction:
|
||||
post_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
|
||||
//console.log("put data to " + _base);
|
||||
@ -421,5 +421,5 @@ export class HttpOAuthWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ import { HttpClient, HttpHeaders, HttpParams, HttpRequest, HttpEvent, HttpEventT
|
||||
import { catchError, map, tap } from 'rxjs/operators';
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
import { SessionService } from 'app/service/session';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { SessionService } from './session';
|
||||
|
||||
@Injectable()
|
||||
export class HttpWrapperService {
|
||||
@ -404,8 +404,8 @@ export class HttpWrapperService {
|
||||
self.post(url, headers, _multipart, _progress)
|
||||
.then(function(response: any) {
|
||||
console.log("URL: " + url + "\nRespond(" + response.status + "): " + JSON.stringify(response.data, null, 2));
|
||||
if (response.status == 200) {
|
||||
resolve(response.data);
|
||||
if (response.status >= 200 && response.status <= 299) {
|
||||
resolve(response.data.body);
|
||||
return;
|
||||
}
|
||||
reject("An error occured");
|
||||
@ -484,7 +484,7 @@ export class HttpWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// Complex wrapper to simplify interaction:
|
||||
delete_specific(_base:string, _id:number, _subElement:string = ""):any {
|
||||
@ -521,7 +521,7 @@ export class HttpWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
// Complex wrapper to simplify interaction:
|
||||
put_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
|
||||
//console.log("put data to " + _base);
|
||||
@ -557,7 +557,7 @@ export class HttpWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
// Complex wrapper to simplify interaction:
|
||||
post_specific(_base:string, _id:number, _data:any, _subElement:string = ""):any {
|
||||
//console.log("put data to " + _base);
|
||||
@ -593,5 +593,5 @@ export class HttpWrapperService {
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
import { DataInterface } from 'app/service/dataInterface';
|
||||
import { environment } from 'environments/environment';
|
||||
import { BddService } from 'app/service/bdd';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from './dataInterface';
|
||||
import { BddService } from './bdd';
|
||||
|
||||
@Injectable()
|
||||
export class SaisonService {
|
||||
export class SeasonService {
|
||||
// 0: Not hide password; 1 hide password;
|
||||
private identificationVersion: number = 1;
|
||||
private serviceName:string = "saison";
|
||||
private serviceName:string = "season";
|
||||
|
||||
constructor(private http: HttpWrapperService,
|
||||
private bdd: BddService) {
|
||||
console.log("Start SaisonService");
|
||||
console.log("Start SeasonService");
|
||||
}
|
||||
|
||||
|
||||
get(_id:number):any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getSaison()
|
||||
self.bdd.getSeason()
|
||||
.then(function(response) {
|
||||
let data = response.get(_id);
|
||||
if (data === null || data === undefined) {
|
||||
@ -37,8 +36,8 @@ export class SaisonService {
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getVideo()
|
||||
.then(function(response) {
|
||||
//let data = response.gets_where([["==", "saison_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]], ["id", "name", "episode"], ["episode", "name"])
|
||||
let data = response.gets_where([["==", "season_id", _id]], undefined, ["episode", "name"])
|
||||
resolve(data);
|
||||
}).catch(function(response) {
|
||||
reject(response);
|
||||
@ -50,8 +49,8 @@ export class SaisonService {
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getVideo()
|
||||
.then(function(response) {
|
||||
//let data = response.gets_where([["==", "saison_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]], ["id", "name", "episode"], ["episode", "name"])
|
||||
let data = response.gets_where([["==", "season_id", _id]], undefined, ["episode", "name"])
|
||||
resolve(data.length);
|
||||
}).catch(function(response) {
|
||||
reject(response);
|
@ -1,25 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
import { DataInterface } from 'app/service/dataInterface';
|
||||
import { BddService } from 'app/service/bdd';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from './dataInterface';
|
||||
import { BddService } from './bdd';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class GroupService {
|
||||
export class SeriesService {
|
||||
// 0: Not hide password; 1 hide password;
|
||||
private identificationVersion: number = 1;
|
||||
private serviceName:string = "group";
|
||||
private serviceName:string = "series";
|
||||
|
||||
constructor(private http: HttpWrapperService,
|
||||
private bdd: BddService) {
|
||||
console.log("Start GroupService");
|
||||
console.log("Start SeriesService");
|
||||
}
|
||||
|
||||
get(_id:number):any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getGroup()
|
||||
self.bdd.getSeries()
|
||||
.then(function(response) {
|
||||
let data = response.get(_id);
|
||||
if (data === null || data === undefined) {
|
||||
@ -32,12 +31,12 @@ export class GroupService {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
getData():any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getGroup()
|
||||
self.bdd.getSeries()
|
||||
.then(function(response) {
|
||||
let data = response.gets();
|
||||
resolve(data);
|
||||
@ -46,12 +45,12 @@ export class GroupService {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
getOrder():any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getGroup()
|
||||
self.bdd.getSeries()
|
||||
.then(function(response) {
|
||||
let data = response.gets_where([["!=", "id", null]], ["id", "name"], ["name","id"])
|
||||
resolve(data);
|
||||
@ -60,30 +59,30 @@ export class GroupService {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
getVideoAll(_id:number):any {
|
||||
//this.checkLocalBdd();
|
||||
};
|
||||
}
|
||||
|
||||
getVideo(_id:number):any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getVideo()
|
||||
.then(function(response) {
|
||||
//let data = response.gets_where([["==", "serie_id", _id], ["==", "saison_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]], ["id"], ["episode", "name"])
|
||||
let data = response.gets_where([["==", "series_id", _id], ["==", "season_id", null]], undefined, ["episode", "name"])
|
||||
resolve(data);
|
||||
}).catch(function(response) {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
getSaison(_id:number, _select:Array<string> = []):any {
|
||||
getSeason(_id:number, _select:Array<string> = []):any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getSaison()
|
||||
self.bdd.getSeason()
|
||||
.then(function(response) {
|
||||
let data = response.gets_where([["==", "parent_id", _id]], ["id"], ["number"])
|
||||
if (_select.length == 0) {
|
||||
@ -102,30 +101,31 @@ export class GroupService {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
put(_id:number, _data:any):any {
|
||||
let ret = this.http.put_specific(this.serviceName, _id, _data);
|
||||
return this.bdd.setAfterPut(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 {
|
||||
return this.http.createRESTCall("data/" + _coverId);
|
||||
};
|
||||
}
|
||||
|
||||
getCoverThumbnailUrl(_coverId:number):any {
|
||||
return this.http.createRESTCall("data/thumbnail/" + _coverId);
|
||||
};
|
||||
}
|
||||
|
||||
getLike(_nameGroup:string):any {
|
||||
getLike(_nameSeries:string):any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getGroup()
|
||||
self.bdd.getSeries()
|
||||
.then(function(response) {
|
||||
let data = response.getNameLike(_nameGroup);
|
||||
let data = response.getNameLike(_nameSeries);
|
||||
if (data === null || data === undefined) {
|
||||
reject("Data does not exist in the local BDD");
|
||||
return;
|
@ -1,11 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
//import { SHA512 } from 'assets/js_3rd_party/sha512';
|
||||
import { DataInterface } from 'app/service/dataInterface';
|
||||
import { BddService } from 'app/service/bdd';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from './dataInterface';
|
||||
import { BddService } from './bdd';
|
||||
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
export interface MessageLogIn {
|
||||
id: number;
|
||||
@ -66,16 +64,16 @@ export class TypeService {
|
||||
self.bdd.getVideo()
|
||||
.then(function(response) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
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);
|
||||
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);
|
||||
return;
|
||||
}).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;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getVideo()
|
||||
.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) {
|
||||
resolve(data);
|
||||
return;
|
||||
}
|
||||
self.bdd.getGroup()
|
||||
self.bdd.getSeries()
|
||||
.then(function(response2) {
|
||||
if (_select[0] == "*") {
|
||||
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;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getVideo()
|
||||
.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) {
|
||||
resolve(data);
|
||||
return;
|
||||
}
|
||||
self.bdd.getUnivers()
|
||||
self.bdd.getUniverse()
|
||||
.then(function(response2) {
|
||||
if (_select[0] == "*") {
|
||||
let data2 = response2.gets_where([["==", "id", data]], undefined, ["name"]);
|
||||
|
@ -1,25 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
import { DataInterface } from 'app/service/dataInterface';
|
||||
import { BddService } from 'app/service/bdd';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from './dataInterface';
|
||||
import { BddService } from './bdd';
|
||||
|
||||
@Injectable()
|
||||
export class UniversService {
|
||||
export class UniverseService {
|
||||
// 0: Not hide password; 1 hide password;
|
||||
private identificationVersion: number = 1;
|
||||
private serviceName:string = "univers";
|
||||
private serviceName:string = "universe";
|
||||
|
||||
constructor(private http: HttpWrapperService,
|
||||
private bdd: BddService) {
|
||||
console.log("Start universService");
|
||||
console.log("Start universeService");
|
||||
}
|
||||
|
||||
getData():any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getUnivers()
|
||||
self.bdd.getUniverse()
|
||||
.then(function(response) {
|
||||
let data = response.gets();
|
||||
resolve(data);
|
||||
@ -27,12 +25,12 @@ export class UniversService {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
get(_id:number):any {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.bdd.getUnivers()
|
||||
self.bdd.getUniverse()
|
||||
.then(function(response) {
|
||||
let data = response.get(_id);
|
||||
if (data === null || data === undefined) {
|
||||
@ -44,25 +42,25 @@ export class UniversService {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
getSubGroup(_id:number, _select:Array<string> = []):any {
|
||||
getSubSeries(_id:number, _select:Array<string> = []):any {
|
||||
//this.checkLocalBdd();
|
||||
};
|
||||
}
|
||||
|
||||
getSubVideo(_id:number, _select:Array<string> = []):any {
|
||||
//this.checkLocalBdd();
|
||||
};
|
||||
}
|
||||
|
||||
put(_id:number, _data:any):any {
|
||||
let ret = this.http.put_specific(this.serviceName, _id, _data);
|
||||
return this.bdd.setAfterPut(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 {
|
||||
return this.http.createRESTCall("data/" + _coverId);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpOAuthWrapperService } from 'app/service/http-oauth-wrapper';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
import { HttpOAuthWrapperService } from './http-oauth-wrapper';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
//import { SHA512 } from 'assets/js_3rd_party/sha512';
|
||||
|
||||
interface MessageLogIn {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpWrapperService } from 'app/service/http-wrapper';
|
||||
import { DataInterface } from 'app/service/dataInterface';
|
||||
import { BddService } from 'app/service/bdd';
|
||||
import { HttpWrapperService } from './http-wrapper';
|
||||
import { DataInterface } from './dataInterface';
|
||||
import { BddService } from './bdd';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class VideoService {
|
||||
@ -42,20 +42,17 @@ export class VideoService {
|
||||
let ret = this.http.delete_specific(this.serviceName, _id);
|
||||
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 {
|
||||
return this.http.createRESTCall("data/" + _coverId);
|
||||
}
|
||||
getCoverThumbnailUrl(_coverId:number):any {
|
||||
return this.http.createRESTCall("data/thumbnail/" + _coverId);
|
||||
}
|
||||
|
||||
|
||||
uploadFile(_file:File,
|
||||
_universe:string,
|
||||
_serie:string,
|
||||
_saison:number,
|
||||
_series:string,
|
||||
_season:number,
|
||||
_episode:number,
|
||||
_title:string,
|
||||
_type_id:number,
|
||||
@ -63,11 +60,11 @@ export class VideoService {
|
||||
const formData = new FormData();
|
||||
formData.append('file_name', _file.name);
|
||||
formData.append('universe', _universe);
|
||||
formData.append('serie', _serie);
|
||||
if (_saison != null) {
|
||||
formData.append('saison', _saison.toString());
|
||||
formData.append('series', _series);
|
||||
if (_season != null) {
|
||||
formData.append('season', _season.toString());
|
||||
} else {
|
||||
formData.append('saison', null);
|
||||
formData.append('season', null);
|
||||
}
|
||||
|
||||
if (_episode != null) {
|
||||
@ -85,5 +82,48 @@ export class VideoService {
|
||||
formData.append('file', _file);
|
||||
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);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user