[DEV] better upload
This commit is contained in:
parent
9eb301731e
commit
14c10f4885
@ -46,7 +46,7 @@ ADD front/e2e \
|
|||||||
ADD front/src /tmp/src
|
ADD front/src /tmp/src
|
||||||
|
|
||||||
# generate build
|
# generate build
|
||||||
RUN ng build --output-path=dist --configuration=production --base-href=/karideo/ --deploy-url=/karideo/
|
RUN ng build --output-path=dist --configuration=production --base-href=/karusic/ --deploy-url=/karusic/
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
##
|
##
|
||||||
@ -70,10 +70,10 @@ RUN apk add --no-cache wget
|
|||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar
|
COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar
|
||||||
COPY --from=buildFront /tmp/dist /application/karideo/
|
COPY --from=buildFront /tmp/dist /application/karusic/
|
||||||
|
|
||||||
WORKDIR /application/
|
WORKDIR /application/
|
||||||
|
|
||||||
EXPOSE 17080
|
EXPOSE 17080
|
||||||
|
|
||||||
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karideo.WebLauncher"]
|
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karusic.WebLauncher"]
|
||||||
|
@ -17,5 +17,5 @@ WORKDIR /application/
|
|||||||
|
|
||||||
EXPOSE 18080
|
EXPOSE 18080
|
||||||
|
|
||||||
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karideo.WebLauncher"]
|
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karusic.WebLauncher"]
|
||||||
|
|
||||||
|
@ -32,3 +32,11 @@ npx ng lint
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
build the local image:
|
||||||
|
|
||||||
|
docker build -t gitea.atria-soft.org/kangaroo-and-rabbit/karideo:latest .
|
||||||
|
|
||||||
|
docker login gitea.atria-soft.org
|
||||||
|
|
||||||
|
docker push gitea.atria-soft.org/kangaroo-and-rabbit/karideo:latest
|
@ -1,8 +1,8 @@
|
|||||||
<div class="bottom" *ngIf="mediaSource">
|
<div class="bottom" *ngIf="mediaSource">
|
||||||
<div class="media" >
|
<div class="media" >
|
||||||
<div class="media-elem">
|
<div class="media-elem">
|
||||||
<audio src="{{mediaSource}}"
|
<video width="1" height="1" src="{{mediaSource}}"
|
||||||
#audioPlayer
|
#mediaPlayer
|
||||||
preload
|
preload
|
||||||
(play)="changeStateToPlay()"
|
(play)="changeStateToPlay()"
|
||||||
(pause)="changeStateToPause()"
|
(pause)="changeStateToPause()"
|
||||||
@ -13,7 +13,7 @@
|
|||||||
(ended)="onAudioEnded()"
|
(ended)="onAudioEnded()"
|
||||||
><!-- controls > --> <!--preload="none"-->
|
><!-- controls > --> <!--preload="none"-->
|
||||||
<!--<p>Your browser does not support HTML5 media player. download media: <a href="{{mediaSource}}>link here</a>.</p>-->
|
<!--<p>Your browser does not support HTML5 media player. download media: <a href="{{mediaSource}}>link here</a>.</p>-->
|
||||||
</audio>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<button (click)="onPlay()" *ngIf="!isPlaying" ><i class="material-icons">play_arrow</i></button>
|
<button (click)="onPlay()" *ngIf="!isPlaying" ><i class="material-icons">play_arrow</i></button>
|
||||||
@ -37,8 +37,18 @@
|
|||||||
<button (click)="onPlayMode()"><i class="material-icons">{{playMode}}</i></button>
|
<button (click)="onPlayMode()"><i class="material-icons">{{playMode}}</i></button>
|
||||||
<!--<button (click)="onMore()" ><i class="material-icons">more_vert</i></button>-->
|
<!--<button (click)="onMore()" ><i class="material-icons">more_vert</i></button>-->
|
||||||
<!--<button (click)="onTakeScreenShoot()"><i class="material-icons">add_a_photo</i></button>-->
|
<!--<button (click)="onTakeScreenShoot()"><i class="material-icons">add_a_photo</i></button>-->
|
||||||
<!--<button (click)="onVolumeMenu()" ><i class="material-icons">volume_up</i></button> -->
|
<button (click)="onVolumeMenu()" ><i class="material-icons">volume_up</i></button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="volume" *ngIf="volume_displayMenu">
|
||||||
|
<div class="volume-menu">
|
||||||
|
<div class="slidecontainer">
|
||||||
|
<input type="range" min="0" max="100" class="slider"
|
||||||
|
[value]="volumeValue"
|
||||||
|
(input)="onVolume($event.target)">
|
||||||
|
</div>
|
||||||
|
<button (click)="onVolumeMute()" *ngIf="!mediaPlayer.muted"><i class="material-icons">volume_mute</i></button>
|
||||||
|
<button (click)="onVolumeUnMute()" *ngIf="mediaPlayer.muted"><i class="material-icons">volume_off</i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
@ -27,13 +27,13 @@ export enum PlayMode {
|
|||||||
styleUrls: [ './element-player-audio.less' ]
|
styleUrls: [ './element-player-audio.less' ]
|
||||||
})
|
})
|
||||||
export class ElementPlayerAudioComponent implements OnInit {
|
export class ElementPlayerAudioComponent implements OnInit {
|
||||||
audioPlayer: HTMLAudioElement;
|
mediaPlayer: HTMLVideoElement;
|
||||||
duration: number;
|
duration: number;
|
||||||
durationDisplay: string;
|
durationDisplay: string;
|
||||||
@ViewChild('audioPlayer')
|
@ViewChild('mediaPlayer')
|
||||||
set mainVideoEl(el: ElementRef) {
|
set mainVideoEl(el: ElementRef) {
|
||||||
if(el !== null && el !== undefined) {
|
if(el !== null && el !== undefined) {
|
||||||
this.audioPlayer = el.nativeElement;
|
this.mediaPlayer = el.nativeElement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public mediaSource: string = undefined;
|
public mediaSource: string = undefined;
|
||||||
@ -44,6 +44,10 @@ export class ElementPlayerAudioComponent implements OnInit {
|
|||||||
public counttrack: number;
|
public counttrack: number;
|
||||||
|
|
||||||
public covers: string[];
|
public covers: string[];
|
||||||
|
|
||||||
|
public volume_value: number = 100;
|
||||||
|
public volume_displayMenu: boolean = false;
|
||||||
|
|
||||||
playStream: boolean;
|
playStream: boolean;
|
||||||
isPlaying: boolean;
|
isPlaying: boolean;
|
||||||
currentTime: any;
|
currentTime: any;
|
||||||
@ -286,14 +290,14 @@ export class ElementPlayerAudioComponent implements OnInit {
|
|||||||
} else if (this.playMode === PlayMode.PLAY_ALL) {
|
} else if (this.playMode === PlayMode.PLAY_ALL) {
|
||||||
this.onNext();
|
this.onNext();
|
||||||
} else if (this.playMode === PlayMode.PLAY_ONE_LOOP) {
|
} else if (this.playMode === PlayMode.PLAY_ONE_LOOP) {
|
||||||
this.audioPlayer.currentTime = 0;
|
this.mediaPlayer.currentTime = 0;
|
||||||
this.onPlay();
|
this.onPlay();
|
||||||
} else {
|
} else {
|
||||||
if (this.localIdStreaming == this.localListStreaming.length-1) {
|
if (this.localIdStreaming == this.localListStreaming.length-1) {
|
||||||
this.localIdStreaming = 0;
|
this.localIdStreaming = 0;
|
||||||
this.updateMediaStreamed();
|
this.updateMediaStreamed();
|
||||||
if (this.localListStreaming.length == 1) {
|
if (this.localListStreaming.length == 1) {
|
||||||
this.audioPlayer.currentTime = 0;
|
this.mediaPlayer.currentTime = 0;
|
||||||
this.onPlay();
|
this.onPlay();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -338,37 +342,37 @@ export class ElementPlayerAudioComponent implements OnInit {
|
|||||||
changeTimeupdate(currentTime: any) {
|
changeTimeupdate(currentTime: any) {
|
||||||
// console.log("time change ");
|
// console.log("time change ");
|
||||||
// console.log(" ==> " + this.audioPlayer.currentTime);
|
// console.log(" ==> " + this.audioPlayer.currentTime);
|
||||||
this.currentTime = this.audioPlayer.currentTime;
|
this.currentTime = this.mediaPlayer.currentTime;
|
||||||
this.currentTimeDisplay = this.convertIndisplayTime(this.currentTime);
|
this.currentTimeDisplay = this.convertIndisplayTime(this.currentTime);
|
||||||
// console.log(" ==> " + this.currentTimeDisplay);
|
// console.log(" ==> " + this.currentTimeDisplay);
|
||||||
}
|
}
|
||||||
changeDurationchange(duration: any) {
|
changeDurationchange(duration: any) {
|
||||||
console.log('duration change ');
|
console.log('duration change ');
|
||||||
console.log(` ==> ${ this.audioPlayer.duration}`);
|
console.log(` ==> ${ this.mediaPlayer.duration}`);
|
||||||
this.duration = this.audioPlayer.duration;
|
this.duration = this.mediaPlayer.duration;
|
||||||
this.durationDisplay = this.convertIndisplayTime(this.duration);
|
this.durationDisplay = this.convertIndisplayTime(this.duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
onPlay() {
|
onPlay() {
|
||||||
console.log('play');
|
console.log('play');
|
||||||
|
|
||||||
if(this.audioPlayer === null ||
|
if(this.mediaPlayer === null ||
|
||||||
this.audioPlayer === undefined) {
|
this.mediaPlayer === undefined) {
|
||||||
console.log(`error element: ${ this.audioPlayer}`);
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.audioPlayer.play();
|
this.mediaPlayer.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
onPause() {
|
onPause() {
|
||||||
console.log('pause');
|
console.log('pause');
|
||||||
|
|
||||||
if(this.audioPlayer === null ||
|
if(this.mediaPlayer === null ||
|
||||||
this.audioPlayer === undefined) {
|
this.mediaPlayer === undefined) {
|
||||||
console.log(`error element: ${ this.audioPlayer}`);
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.audioPlayer.pause();
|
this.mediaPlayer.pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
onPauseToggle() {
|
onPauseToggle() {
|
||||||
@ -383,13 +387,13 @@ export class ElementPlayerAudioComponent implements OnInit {
|
|||||||
onStop() {
|
onStop() {
|
||||||
console.log('stop');
|
console.log('stop');
|
||||||
|
|
||||||
if(this.audioPlayer === null ||
|
if(this.mediaPlayer === null ||
|
||||||
this.audioPlayer === undefined) {
|
this.mediaPlayer === undefined) {
|
||||||
console.log(`error element: ${ this.audioPlayer}`);
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.audioPlayer.pause();
|
this.mediaPlayer.pause();
|
||||||
this.audioPlayer.currentTime = 0;
|
this.mediaPlayer.currentTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
onBefore() {
|
onBefore() {
|
||||||
@ -417,45 +421,82 @@ export class ElementPlayerAudioComponent implements OnInit {
|
|||||||
seek(newValue:any) {
|
seek(newValue:any) {
|
||||||
console.log(`seek ${ newValue.value}`);
|
console.log(`seek ${ newValue.value}`);
|
||||||
|
|
||||||
if(this.audioPlayer === null ||
|
if(this.mediaPlayer === null ||
|
||||||
this.audioPlayer === undefined) {
|
this.mediaPlayer === undefined) {
|
||||||
console.log(`error element: ${ this.audioPlayer}`);
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.audioPlayer.currentTime = newValue.value;
|
this.mediaPlayer.currentTime = newValue.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
onRewind() {
|
onRewind() {
|
||||||
console.log('rewind');
|
console.log('rewind');
|
||||||
|
|
||||||
if(this.audioPlayer === null ||
|
if(this.mediaPlayer === null ||
|
||||||
this.audioPlayer === undefined) {
|
this.mediaPlayer === undefined) {
|
||||||
console.log(`error element: ${ this.audioPlayer}`);
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.audioPlayer.currentTime = this.currentTime - 10;
|
this.mediaPlayer.currentTime = this.currentTime - 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
onForward() {
|
onForward() {
|
||||||
console.log('forward');
|
console.log('forward');
|
||||||
|
|
||||||
if(this.audioPlayer === null ||
|
if(this.mediaPlayer === null ||
|
||||||
this.audioPlayer === undefined) {
|
this.mediaPlayer === undefined) {
|
||||||
console.log(`error element: ${ this.audioPlayer}`);
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.audioPlayer.currentTime = this.currentTime + 10;
|
this.mediaPlayer.currentTime = this.currentTime + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMore() {
|
onMore() {
|
||||||
console.log('more');
|
console.log('more');
|
||||||
|
|
||||||
if(this.audioPlayer === null ||
|
if(this.mediaPlayer === null ||
|
||||||
this.audioPlayer === undefined) {
|
this.mediaPlayer === undefined) {
|
||||||
console.log(`error element: ${ this.audioPlayer}`);
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVolumeMenu() {
|
||||||
|
this.volume_displayMenu = !this.volume_displayMenu;
|
||||||
|
//this.startHideTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
onVolume(newValue:any) {
|
||||||
|
console.log(`onVolume ${ newValue.value}`);
|
||||||
|
//this.startHideTimer();
|
||||||
|
if(this.mediaPlayer === null ||
|
||||||
|
this.mediaPlayer === undefined) {
|
||||||
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.volume_value = newValue.value;
|
||||||
|
this.mediaPlayer.volume = this.volume_value / 100;
|
||||||
|
this.mediaPlayer.muted = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onVolumeMute() {
|
||||||
|
//this.startHideTimer();
|
||||||
|
if(this.mediaPlayer === null ||
|
||||||
|
this.mediaPlayer === undefined) {
|
||||||
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.mediaPlayer.muted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
onVolumeUnMute() {
|
||||||
|
//this.startHideTimer();
|
||||||
|
if(this.mediaPlayer === null ||
|
||||||
|
this.mediaPlayer === undefined) {
|
||||||
|
console.log(`error element: ${ this.mediaPlayer}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.mediaPlayer.muted = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="fill-all" *ngIf="login !== null && displayUserMenu === true" (click)="onOutUserProperty()">
|
<div class="fill-all" *ngIf="login && displayUserMenu === true" (click)="onOutUserProperty()">
|
||||||
<!-- (click)="onOutUserProperty()" -->
|
<!-- (click)="onOutUserProperty()" -->
|
||||||
<div class="sub-menu user-menu color-menu-background">
|
<div class="sub-menu user-menu color-menu-background">
|
||||||
<button class="item" disabled="disabled">
|
<button class="item" disabled="disabled">
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
<input type="text"
|
<input type="text"
|
||||||
placeholder="Genre of the Media"
|
placeholder="Genre of the Media"
|
||||||
[value]="globalGender"
|
[value]="globalGender"
|
||||||
(input)="onGenre($event.target.value)"
|
(input)="onGender($event.target.value)"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
<td class="left-colomn"></td>
|
<td class="left-colomn"></td>
|
||||||
<td class="right-colomn">
|
<td class="right-colomn">
|
||||||
<select [ngModel]="genreId"
|
<select [ngModel]="genreId"
|
||||||
(ngModelChange)="onChangeGenre($event)">
|
(ngModelChange)="onChangeGender($event)">
|
||||||
<option *ngFor="let element of listGender" [ngValue]="element.value">{{element.label}}</option>
|
<option *ngFor="let element of listGender" [ngValue]="element.value">{{element.label}}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
|
@ -8,6 +8,7 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { GenderService, PlaylistService, ArtistService, TrackService, ArianeService, AlbumService } from 'app/service';
|
import { GenderService, PlaylistService, ArtistService, TrackService, ArianeService, AlbumService } from 'app/service';
|
||||||
|
import { NodeData } from 'common/model';
|
||||||
import { UploadProgress } from 'common/popin/upload-progress/upload-progress';
|
import { UploadProgress } from 'common/popin/upload-progress/upload-progress';
|
||||||
import { PopInService } from 'common/service';
|
import { PopInService } from 'common/service';
|
||||||
|
|
||||||
@ -142,8 +143,9 @@ export class UploadScene implements OnInit {
|
|||||||
}).catch((response2) => {
|
}).catch((response2) => {
|
||||||
console.log(`get response22 : ${ JSON.stringify(response2, null, 2)}`);
|
console.log(`get response22 : ${ JSON.stringify(response2, null, 2)}`);
|
||||||
});
|
});
|
||||||
this.genderService.getData()
|
this.genderService.getOrder()
|
||||||
.then((response2) => {
|
.then((response2: NodeData[]) => {
|
||||||
|
//console.error(`Keep gender : ${ JSON.stringify(response2, null, 2)} ==> ${response2.length}`);
|
||||||
for(let iii = 0; iii < response2.length; iii++) {
|
for(let iii = 0; iii < response2.length; iii++) {
|
||||||
self.listGender.push({ value: response2[iii].id, label: response2[iii].name });
|
self.listGender.push({ value: response2[iii].id, label: response2[iii].name });
|
||||||
}
|
}
|
||||||
@ -182,6 +184,67 @@ export class UploadScene implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onGender(value: any): void {
|
||||||
|
this.globalGender = value;
|
||||||
|
let self = this;
|
||||||
|
if(this.globalGender !== '') {
|
||||||
|
this.genderService.getLike(this.globalGender)
|
||||||
|
.then((response: any[]) => {
|
||||||
|
console.log(`find element: ${ response.length}`);
|
||||||
|
for(let iii = 0; iii < response.length; iii++) {
|
||||||
|
console.log(` - ${ JSON.stringify(response[iii])}`);
|
||||||
|
}
|
||||||
|
if(response.length === 0) {
|
||||||
|
self.genderId = null;
|
||||||
|
} else if(response.length === 1) {
|
||||||
|
self.genderId = response[0].id;
|
||||||
|
}
|
||||||
|
}).catch((response) => {
|
||||||
|
console.log('CAN NOT find element: ');
|
||||||
|
self.genderId = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.updateNeedSend();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onChangeGender(value: any): void {
|
||||||
|
this.globalGender = value;
|
||||||
|
if(!(value === undefined || value === null)) {
|
||||||
|
for(let iii = 0; iii < this.listGender.length; iii++) {
|
||||||
|
if(this.listGender[iii].value === value) {
|
||||||
|
this.globalGender = this.listGender[iii].label;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.updateNeedSend();
|
||||||
|
}
|
||||||
|
|
||||||
|
onArtist(value: any): void {
|
||||||
|
this.globalArtist = value;
|
||||||
|
let self = this;
|
||||||
|
if(this.globalArtist !== '') {
|
||||||
|
this.artistService.getLike(this.globalArtist)
|
||||||
|
.then((response: any[]) => {
|
||||||
|
console.log(`find element: ${ response.length}`);
|
||||||
|
for(let iii = 0; iii < response.length; iii++) {
|
||||||
|
console.log(` - ${ JSON.stringify(response[iii])}`);
|
||||||
|
}
|
||||||
|
if(response.length === 0) {
|
||||||
|
self.artistId = null;
|
||||||
|
} else if(response.length === 1) {
|
||||||
|
self.artistId = response[0].id;
|
||||||
|
}
|
||||||
|
self.updateListOfTrackToCheck();
|
||||||
|
}).catch((response) => {
|
||||||
|
console.log('CAN NOT find element: ');
|
||||||
|
self.artistId = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.updateNeedSend();
|
||||||
|
}
|
||||||
onChangeArtist(value: any): void {
|
onChangeArtist(value: any): void {
|
||||||
this.artistId = value;
|
this.artistId = value;
|
||||||
if(!(value === undefined || value === null)) {
|
if(!(value === undefined || value === null)) {
|
||||||
@ -217,40 +280,12 @@ export class UploadScene implements OnInit {
|
|||||||
this.updateNeedSend();
|
this.updateNeedSend();
|
||||||
}
|
}
|
||||||
|
|
||||||
onGender(value: any): void {
|
|
||||||
this.globalGender = value;
|
|
||||||
this.updateNeedSend();
|
|
||||||
}
|
|
||||||
|
|
||||||
onEpisode(data: FileParsedElement, value: any): void {
|
onEpisode(data: FileParsedElement, value: any): void {
|
||||||
data.trackId = value;
|
data.trackId = value;
|
||||||
// console.log("change episode ID: " + value + " ==> " + this.parseEpisode.toString());
|
// console.log("change episode ID: " + value + " ==> " + this.parseEpisode.toString());
|
||||||
this.updateNeedSend();
|
this.updateNeedSend();
|
||||||
}
|
}
|
||||||
|
|
||||||
onArtist(value: any): void {
|
|
||||||
this.globalArtist = value;
|
|
||||||
let self = this;
|
|
||||||
if(this.globalArtist !== '') {
|
|
||||||
this.artistService.getLike(this.globalArtist)
|
|
||||||
.then((response: any[]) => {
|
|
||||||
console.log(`find element: ${ response.length}`);
|
|
||||||
for(let iii = 0; iii < response.length; iii++) {
|
|
||||||
console.log(` - ${ JSON.stringify(response[iii])}`);
|
|
||||||
}
|
|
||||||
if(response.length === 0) {
|
|
||||||
self.artistId = null;
|
|
||||||
} else if(response.length === 1) {
|
|
||||||
self.artistId = response[0].id;
|
|
||||||
}
|
|
||||||
self.updateListOfTrackToCheck();
|
|
||||||
}).catch((response) => {
|
|
||||||
console.log('CAN NOT find element: ');
|
|
||||||
self.artistId = null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.updateNeedSend();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
clearData() {
|
clearData() {
|
||||||
@ -264,7 +299,7 @@ export class UploadScene implements OnInit {
|
|||||||
this.genderId = null;
|
this.genderId = null;
|
||||||
this.artistId = null;
|
this.artistId = null;
|
||||||
this.saisonId = null;
|
this.saisonId = null;
|
||||||
this.listGender = [ { value: null, label: '---' } ];
|
//this.listGender = [ { value: null, label: '---' } ];
|
||||||
this.listArtist = [ { value: null, label: '---' } ];
|
this.listArtist = [ { value: null, label: '---' } ];
|
||||||
this.listAlbum = [ { value: null, label: '---' } ];
|
this.listAlbum = [ { value: null, label: '---' } ];
|
||||||
}
|
}
|
||||||
@ -291,14 +326,14 @@ export class UploadScene implements OnInit {
|
|||||||
album = splitElement2[0];
|
album = splitElement2[0];
|
||||||
tmpName = tmpName.substring(album.length+1);
|
tmpName = tmpName.substring(album.length+1);
|
||||||
}
|
}
|
||||||
console.log("ploppppp " + tmpName);
|
//console.log("ploppppp " + tmpName);
|
||||||
const splitElement3 = tmpName.split('-');
|
const splitElement3 = tmpName.split('-');
|
||||||
if(splitElement3.length > 1) {
|
if(splitElement3.length > 1) {
|
||||||
trackIdNumber = parseInt(splitElement3[0], 10);
|
trackIdNumber = parseInt(splitElement3[0], 10);
|
||||||
tmpName = tmpName.substring(splitElement3[0].length+1);
|
tmpName = tmpName.substring(splitElement3[0].length+1);
|
||||||
}
|
}
|
||||||
console.log("KKKppppp " + tmpName);
|
//console.log("KKKppppp " + tmpName);
|
||||||
console.log(" ===> " + splitElement3[0]);
|
//console.log(" ===> " + splitElement3[0]);
|
||||||
title = tmpName;
|
title = tmpName;
|
||||||
|
|
||||||
if(isNaN(trackIdNumber)) {
|
if(isNaN(trackIdNumber)) {
|
||||||
@ -327,7 +362,7 @@ export class UploadScene implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// we verify fith the first value to remove all unknown ...
|
// we verify fith the first value to remove all unknown ...
|
||||||
// clean different univers:
|
// clean different gender:
|
||||||
/*for(let iii = 1; iii < this.parsedElement.length; iii++) {
|
/*for(let iii = 1; iii < this.parsedElement.length; iii++) {
|
||||||
console.log(`check gender [${ iii + 1 }/${ this.parsedElement.length }] '${ this.parsedElement[0].gender } !== ${ this.parsedElement[iii].gender }'`);
|
console.log(`check gender [${ iii + 1 }/${ this.parsedElement.length }] '${ this.parsedElement[0].gender } !== ${ this.parsedElement[iii].gender }'`);
|
||||||
if(this.parsedElement[0].gender !== this.parsedElement[iii].gender) {
|
if(this.parsedElement[0].gender !== this.parsedElement[iii].gender) {
|
||||||
@ -366,25 +401,7 @@ export class UploadScene implements OnInit {
|
|||||||
this.artistId = null;
|
this.artistId = null;
|
||||||
this.saisonId = null;
|
this.saisonId = null;
|
||||||
let self = this;
|
let self = this;
|
||||||
if(this.globalArtist !== '') {
|
this.onArtist(this.globalArtist);
|
||||||
this.artistService.getLike(this.globalArtist)
|
|
||||||
.then((response: any[]) => {
|
|
||||||
console.log(`find element: ${ response.length}`);
|
|
||||||
for(let iii = 0; iii < response.length; iii++) {
|
|
||||||
console.log(` - ${ JSON.stringify(response[iii])}`);
|
|
||||||
}
|
|
||||||
if(response.length === 0) {
|
|
||||||
self.artistId = null;
|
|
||||||
} else if(response.length === 1) {
|
|
||||||
let serieElem = response[0];
|
|
||||||
self.artistId = serieElem.id;
|
|
||||||
self.updateType(serieElem.parentId);
|
|
||||||
}
|
|
||||||
self.updateListOfTrackToCheck();
|
|
||||||
}).catch((response) => {
|
|
||||||
console.log('CAN NOT find element: ');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { NodeData } from "common/model";
|
import { isNodeData, NodeData } from "common/model";
|
||||||
import { HttpWrapperService, BddService } from "common/service";
|
import { HttpWrapperService, BddService } from "common/service";
|
||||||
import { DataInterface, isNullOrUndefined, TypeCheck } from "common/utils";
|
import { DataInterface, isArrayOf, isNullOrUndefined, TypeCheck } from "common/utils";
|
||||||
|
|
||||||
|
|
||||||
export class GenericInterfaceModelDB {
|
export class GenericInterfaceModelDB {
|
||||||
@ -28,6 +28,48 @@ export class GenericInterfaceModelDB {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLike(nameArtist:string):any {
|
||||||
|
let self = this;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
self.bdd.get(self.serviceName)
|
||||||
|
.then((response:DataInterface) => {
|
||||||
|
let data = response.getNameLike(nameArtist);
|
||||||
|
if(data === null || data === undefined || data.length === 0) {
|
||||||
|
reject('Data does not exist in the local BDD');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resolve(data);
|
||||||
|
return;
|
||||||
|
}).catch((response) => {
|
||||||
|
reject(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getOrder(): Promise<NodeData[]> {
|
||||||
|
let self = this;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
self.bdd.get(self.serviceName)
|
||||||
|
.then((response: DataInterface) => {
|
||||||
|
let data = response.getsWhere([
|
||||||
|
{
|
||||||
|
check: TypeCheck.NOT_EQUAL,
|
||||||
|
key: 'id',
|
||||||
|
value: [undefined, null],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[ 'name', 'id' ]);
|
||||||
|
//data = response.gets();
|
||||||
|
if (isArrayOf(data, isNodeData)) {
|
||||||
|
resolve(data);
|
||||||
|
}
|
||||||
|
reject("The model is wrong ...");
|
||||||
|
}).catch((response) => {
|
||||||
|
console.log(`[E] ${ self.constructor.name }: can not retrive BDD values`);
|
||||||
|
reject(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
get(id:number): Promise<NodeData> {
|
get(id:number): Promise<NodeData> {
|
||||||
let self = this;
|
let self = this;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -21,30 +21,6 @@ export class ArtistService extends GenericInterfaceModelDB {
|
|||||||
super('artist', http, bdd);
|
super('artist', http, bdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
getOrder(): Promise<NodeData[]> {
|
|
||||||
let self = this;
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
self.bdd.get(self.serviceName)
|
|
||||||
.then((response: DataInterface) => {
|
|
||||||
let data = response.getsWhere([
|
|
||||||
{
|
|
||||||
check: TypeCheck.NOT_EQUAL,
|
|
||||||
key: 'id',
|
|
||||||
value: [undefined, null],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ 'name', 'id' ]);
|
|
||||||
//data = response.gets();
|
|
||||||
if (isArrayOf(data, isNodeData)) {
|
|
||||||
resolve(data);
|
|
||||||
}
|
|
||||||
reject("The model is wrong ...");
|
|
||||||
}).catch((response) => {
|
|
||||||
console.log(`[E] ${ self.constructor.name }: can not retrive BDD values`);
|
|
||||||
reject(response);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all the track for a specific artist
|
* Get all the track for a specific artist
|
||||||
@ -143,22 +119,5 @@ export class ArtistService extends GenericInterfaceModelDB {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getLike(nameArtist:string):any {
|
|
||||||
let self = this;
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
self.bdd.get('artist')
|
|
||||||
.then((response:DataInterface) => {
|
|
||||||
let data = response.getNameLike(nameArtist);
|
|
||||||
if(data === null || data === undefined || data.length === 0) {
|
|
||||||
reject('Data does not exist in the local BDD');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resolve(data);
|
|
||||||
return;
|
|
||||||
}).catch((response) => {
|
|
||||||
reject(response);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { HttpWrapperService, BddService } from 'common/service';
|
import { HttpWrapperService, BddService } from 'common/service';
|
||||||
import { DataInterface, isNullOrUndefined, TypeCheck } from 'common/utils';
|
import { DataInterface, isArrayOf, isNullOrUndefined, TypeCheck } from 'common/utils';
|
||||||
import { NodeData } from 'common/model';
|
import { isNodeData, NodeData } from 'common/model';
|
||||||
import { GenericInterfaceModelDB } from './GenericInterfaceModelDB';
|
import { GenericInterfaceModelDB } from './GenericInterfaceModelDB';
|
||||||
|
|
||||||
export interface MessageLogIn {
|
export interface MessageLogIn {
|
||||||
@ -26,40 +26,6 @@ export class GenderService extends GenericInterfaceModelDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get(id:number): Promise<NodeData> {
|
|
||||||
let self = this;
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
self.bdd.get(self.serviceName)
|
|
||||||
.then((response: DataInterface) => {
|
|
||||||
let data = response.get(id);
|
|
||||||
if(isNullOrUndefined(data)) {
|
|
||||||
reject('Data does not exist in the local BDD');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resolve(data);
|
|
||||||
}).catch((response) => {
|
|
||||||
reject(response);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getData(): Promise<NodeData[]> {
|
|
||||||
let self = this;
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
self.bdd.get(self.serviceName)
|
|
||||||
.then((response: DataInterface) => {
|
|
||||||
let data = response.gets();
|
|
||||||
resolve(data);
|
|
||||||
}).catch((response) => {
|
|
||||||
console.log(`[E] ${ self.constructor.name }: can not retrive BDD values`);
|
|
||||||
reject(response);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
countTrack(id:number): Promise<number> {
|
countTrack(id:number): Promise<number> {
|
||||||
|
@ -49,8 +49,9 @@ export class PopInComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
// open popIn
|
// open popIn
|
||||||
open(): void {
|
open(): void {
|
||||||
|
//console.log(`open pop-in: ${this.id}`);
|
||||||
this.displayPopIn = true;
|
this.displayPopIn = true;
|
||||||
// this.element.show();
|
//this.element.show();
|
||||||
}
|
}
|
||||||
// close popin
|
// close popin
|
||||||
close(): void {
|
close(): void {
|
||||||
|
@ -86,6 +86,7 @@ export class PopInUploadProgress implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
|
//console.log(`Upload progress event : ${JSON.stringify(changes)}`);
|
||||||
this.progress = Math.trunc(this.mediaUploaded * 100 / this.mediaSize);
|
this.progress = Math.trunc(this.mediaUploaded * 100 / this.mediaSize);
|
||||||
this.uploadDisplay = this.convertInHuman(this.mediaUploaded);
|
this.uploadDisplay = this.convertInHuman(this.mediaUploaded);
|
||||||
this.sizeDisplay = this.convertInHuman(this.mediaSize);
|
this.sizeDisplay = this.convertInHuman(this.mediaSize);
|
||||||
|
@ -30,11 +30,11 @@ export class PopInService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open(_id: string) {
|
open(_id: string) {
|
||||||
// console.log("Try to open pop-in: '" + _id + "'");
|
//console.log("Try to open pop-in: '" + _id + "'");
|
||||||
// open popin specified by id
|
// open popin specified by id
|
||||||
for(let iii = 0; iii < this.popins.length; iii++) {
|
for(let iii = 0; iii < this.popins.length; iii++) {
|
||||||
if(this.popins[iii].id === _id) {
|
if(this.popins[iii].id === _id) {
|
||||||
// console.log(" ==>find it ...");
|
//console.log(" ==>find it ...");
|
||||||
this.popins[iii].open();
|
this.popins[iii].open();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,22 @@
|
|||||||
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
|
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
|
||||||
// The list of which env maps to which file can be found in `.angular-cli.json`.
|
// The list of which env maps to which file can be found in `.angular-cli.json`.
|
||||||
|
|
||||||
|
export const environment_back_prod = {
|
||||||
|
production: false,
|
||||||
|
// URL of development API
|
||||||
|
applName: "karusic",
|
||||||
|
defaultServer: "karusic",
|
||||||
|
server: {
|
||||||
|
karusic: 'http://192.168.1.156/karusic/api',
|
||||||
|
karauth: 'http://192.168.1.156/karauth/api',
|
||||||
|
},
|
||||||
|
ssoSignIn: 'http://192.168.1.156/karso/signin/karusic-dev/',
|
||||||
|
ssoSignUp: 'http://192.168.1.156/karso/signup/karusic-dev/',
|
||||||
|
ssoSignOut: 'http://192.168.1.156/karso/signout/karusic-dev/',
|
||||||
|
frontBaseUrl: '',
|
||||||
|
apiMode: 'REWRITE'
|
||||||
|
};
|
||||||
|
|
||||||
export const environment_local = {
|
export const environment_local = {
|
||||||
production: false,
|
production: false,
|
||||||
// URL of development API
|
// URL of development API
|
||||||
|
32
readme.md
32
readme.md
@ -20,27 +20,15 @@ cd ../front
|
|||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
TODO list:
|
build the local image:
|
||||||
==========
|
|
||||||
|
|
||||||
- API to add cover (media && group)
|
docker build -t gitea.atria-soft.org/kangaroo-and-rabbit/karusic:latest .
|
||||||
- GUI to add cover (media && group)
|
|
||||||
- GUI to add a media
|
|
||||||
- GUI to check if media already uploaded
|
|
||||||
- GUI to play the next episode
|
|
||||||
- GUI to do back on the view
|
|
||||||
- GUI corect the reload webPage
|
|
||||||
- API for univers
|
|
||||||
- GUI to change the name of a media
|
|
||||||
- GUI to change the group of the media
|
|
||||||
- GUI to change the saison of the media
|
|
||||||
- GUI to change the episode number of the media
|
|
||||||
- GUI to change the univers of the media
|
|
||||||
- GUI to add new univers, group, saison
|
|
||||||
- Application mode of the GUI
|
|
||||||
- Correct the problem of production mode
|
|
||||||
- API add OAuth model
|
|
||||||
- API add user specific last view and position in videos and series
|
|
||||||
- ...
|
|
||||||
|
|
||||||
|
|
||||||
|
docker login gitea.atria-soft.org
|
||||||
|
|
||||||
|
docker push gitea.atria-soft.org/kangaroo-and-rabbit/karusic:latest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
convert in an angular application:
|
||||||
|
https://betterprogramming.pub/how-to-convert-your-angular-application-to-a-native-mobile-app-android-and-ios-c212b38976df
|
Loading…
x
Reference in New Issue
Block a user