+
+
+
+
- {{ item }}
-
+
+ {{ item }}
+
+
diff --git a/src/app/components/top/top.component.scss b/src/app/components/top/top.component.scss
index 64a9b75e..89cadde6 100644
--- a/src/app/components/top/top.component.scss
+++ b/src/app/components/top/top.component.scss
@@ -50,7 +50,7 @@
.file-container {
max-height: 20px;
- min-width: calc(100vw - 100px);
+ width: 100%;
overflow: hidden;
.icon-video-blank {
@@ -58,10 +58,6 @@
transform: translate(0, 3px);
}
- :nth-child(2) {
- margin-left: 23px;
- }
-
.file-word {
color: $gray-80;
cursor: pointer;
@@ -77,6 +73,12 @@
}
}
+.starRating {
+ float: right;
+ width: 117px;
+ margin-left: 5px;
+}
+
.dark-mode-override {
& .folder-word {
color: $gray-30;
diff --git a/src/app/components/top/top.component.ts b/src/app/components/top/top.component.ts
index 240a7ede..b1efafc6 100644
--- a/src/app/components/top/top.component.ts
+++ b/src/app/components/top/top.component.ts
@@ -1,4 +1,6 @@
+import { ImageElementService } from './../../services/image-element.service';
import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { StarRating } from '../../../../interfaces/final-object.interface';
@Component({
selector: 'app-top-component',
@@ -9,6 +11,12 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
export class TopComponent {
@Input() darkMode: boolean;
+ @Input() index: number;
+ @Input() starRating: StarRating;
+
+ constructor(
+ public imageElementService: ImageElementService,
+ ) { }
// Handle folder input
private _folder = '';
@@ -51,5 +59,4 @@ export class TopComponent {
public openInExplorer(): void {
this.onOpenInExplorer.emit(true);
}
-
}
diff --git a/src/app/components/views/clip/clip.component.ts b/src/app/components/views/clip/clip.component.ts
index 0aaa2b59..e4b11db6 100644
--- a/src/app/components/views/clip/clip.component.ts
+++ b/src/app/components/views/clip/clip.component.ts
@@ -2,6 +2,7 @@ import { Component, HostListener, Input, Output, EventEmitter, OnInit, ChangeDet
import { DomSanitizer } from '@angular/platform-browser';
import { FilePathService } from '../file-path.service';
+import { StarRatingService } from '../../../pipes/star-rating.service';
import { ImageElement } from '../../../../../interfaces/final-object.interface';
import { RightClickEmit, VideoClickEmit } from '../../../../../interfaces/shared-interfaces';
@@ -54,7 +55,8 @@ export class ClipComponent implements OnInit {
constructor(
public filePathService: FilePathService,
public sanitizer: DomSanitizer,
- public cd: ChangeDetectorRef
+ public cd: ChangeDetectorRef,
+ private starRatingService: StarRatingService
) { }
@HostListener('mouseenter') onMouseEnter() {
@@ -104,6 +106,8 @@ export class ClipComponent implements OnInit {
this.folderThumbPaths.push(this.pathToVideo);
this.folderPosterPaths.push(this.poster);
}
+
+ this.starRatingService.changeStarRating(this.video.stars, this.video.index);
}
}
diff --git a/src/app/components/views/details/details.component.ts b/src/app/components/views/details/details.component.ts
index e2a4654c..24a33f85 100644
--- a/src/app/components/views/details/details.component.ts
+++ b/src/app/components/views/details/details.component.ts
@@ -5,6 +5,7 @@ import { BehaviorSubject } from 'rxjs';
import { ManualTagsService } from '../../tags-manual/manual-tags.service';
import { FilePathService } from '../file-path.service';
+import { StarRatingService } from '../../../pipes/star-rating.service';
import { StarRating, ImageElement } from '../../../../../interfaces/final-object.interface';
import { VideoClickEmit, RightClickEmit, TagEmit, RenameFileResponse } from '../../../../../interfaces/shared-interfaces';
@@ -65,7 +66,8 @@ export class DetailsComponent implements OnInit {
constructor(
public filePathService: FilePathService,
public manualTagsService: ManualTagsService,
- public sanitizer: DomSanitizer
+ public sanitizer: DomSanitizer,
+ private starRatingService: StarRatingService
) { }
mouseEnter() {
@@ -85,6 +87,7 @@ export class DetailsComponent implements OnInit {
ngOnInit() {
this.firstFilePath = this.filePathService.createFilePath(this.folderPath, this.hubName, 'thumbnails', this.video.hash);
this.fullFilePath = this.filePathService.createFilePath(this.folderPath, this.hubName, 'filmstrips', this.video.hash);
+ this.starRatingService.changeStarRating(this.star, this.video.index);
}
mouseIsMoving($event) {
diff --git a/src/app/components/views/file/file.component.ts b/src/app/components/views/file/file.component.ts
index a9bbb08a..9788cc2e 100644
--- a/src/app/components/views/file/file.component.ts
+++ b/src/app/components/views/file/file.component.ts
@@ -1,4 +1,6 @@
-import { Component, Input } from '@angular/core';
+import { Component, Input, OnInit } from '@angular/core';
+
+import { StarRatingService } from '../../../pipes/star-rating.service';
import { ImageElement } from '../../../../../interfaces/final-object.interface';
@@ -11,7 +13,7 @@ import { ImageElement } from '../../../../../interfaces/final-object.interface';
'../selected.scss'
]
})
-export class FileComponent {
+export class FileComponent implements OnInit {
@Input() video: ImageElement;
@@ -19,6 +21,12 @@ export class FileComponent {
@Input() largerFont: boolean;
@Input() showMeta: boolean;
- constructor() { }
+ constructor(
+ private starRatingService: StarRatingService
+ ) { }
+
+ ngOnInit() {
+ this.starRatingService.changeStarRating(this.video.stars, this.video.index);
+ }
}
diff --git a/src/app/components/views/filmstrip/filmstrip.component.ts b/src/app/components/views/filmstrip/filmstrip.component.ts
index 5463eeb2..cd37027e 100644
--- a/src/app/components/views/filmstrip/filmstrip.component.ts
+++ b/src/app/components/views/filmstrip/filmstrip.component.ts
@@ -2,6 +2,7 @@ import { Component, Input, OnInit, ViewChild, ElementRef, Output, EventEmitter }
import { DomSanitizer } from '@angular/platform-browser';
import { FilePathService } from '../file-path.service';
+import { StarRatingService } from '../../../pipes/star-rating.service';
import { metaAppear, textAppear } from '../../../common/animations';
@@ -43,11 +44,13 @@ export class FilmstripComponent implements OnInit {
constructor(
public filePathService: FilePathService,
- public sanitizer: DomSanitizer
+ public sanitizer: DomSanitizer,
+ private starRatingService: StarRatingService
) { }
ngOnInit() {
this.fullFilePath = this.filePathService.createFilePath(this.folderPath, this.hubName, 'filmstrips', this.video.hash);
+ this.starRatingService.changeStarRating(this.video.stars, this.video.index);
}
updateFilmXoffset($event) {
diff --git a/src/app/components/views/full/full.component.ts b/src/app/components/views/full/full.component.ts
index 9ea01b5d..44e12d22 100644
--- a/src/app/components/views/full/full.component.ts
+++ b/src/app/components/views/full/full.component.ts
@@ -2,6 +2,7 @@ import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { FilePathService } from '../file-path.service';
+import { StarRatingService } from '../../../pipes/star-rating.service';
import { metaAppear, textAppear } from '../../../common/animations';
@@ -52,12 +53,14 @@ export class FullViewComponent implements OnInit {
constructor(
public filePathService: FilePathService,
- public sanitizer: DomSanitizer
+ public sanitizer: DomSanitizer,
+ private starRatingService: StarRatingService
) { }
ngOnInit() {
this.fullFilePath = this.filePathService.createFilePath(this.folderPath, this.hubName, 'filmstrips', this.video.hash);
this.render();
+ this.starRatingService.changeStarRating(this.video.stars, this.video.index);
}
render(): void {
diff --git a/src/app/components/views/thumbnail/thumbnail.component.ts b/src/app/components/views/thumbnail/thumbnail.component.ts
index 27934bad..cd0f0d4b 100644
--- a/src/app/components/views/thumbnail/thumbnail.component.ts
+++ b/src/app/components/views/thumbnail/thumbnail.component.ts
@@ -1,6 +1,7 @@
import { Component, Input, Output, EventEmitter, OnInit, ElementRef, ViewChild, OnDestroy } from '@angular/core';
import { FilePathService } from '../file-path.service';
+import { StarRatingService } from '../../../pipes/star-rating.service';
import { metaAppear, textAppear } from '../../../common/animations';
@@ -53,7 +54,8 @@ export class ThumbnailComponent implements OnInit, OnDestroy {
scrollInterval: any = null;
constructor(
- public filePathService: FilePathService
+ public filePathService: FilePathService,
+ private starRatingService: StarRatingService
) { }
ngOnInit() {
@@ -73,6 +75,8 @@ export class ThumbnailComponent implements OnInit, OnDestroy {
this.hover = true;
this.percentOffset = this.defaultScreenOffset(this.video);
}
+
+ this.starRatingService.changeStarRating(this.video.stars, this.video.index);
}
defaultScreenOffset(video: ImageElement): number {
diff --git a/src/app/pipes/star-rating.service.ts b/src/app/pipes/star-rating.service.ts
new file mode 100644
index 00000000..67a7ddd4
--- /dev/null
+++ b/src/app/pipes/star-rating.service.ts
@@ -0,0 +1,18 @@
+import { EventEmitter, Injectable, Output } from '@angular/core';
+import { StarRating } from '../../../interfaces/final-object.interface';
+import { BehaviorSubject } from 'rxjs';
+
+@Injectable()
+export class StarRatingService {
+ // finalStarRatingBehaviorSubject = new BehaviorSubject(0.5);
+ finalStarRatingBehaviorSubject = new BehaviorSubject([]);
+ starRatingMap = [];
+ currentStarRating = this.finalStarRatingBehaviorSubject.asObservable();
+
+ constructor() { }
+
+ changeStarRating(star: StarRating, index: number) {
+ this.starRatingMap[index] = star;
+ this.finalStarRatingBehaviorSubject.next(this.starRatingMap);
+ }
+}