|
|
|
@ -2,8 +2,9 @@ import { Component, OnInit } from "@angular/core";
|
|
|
|
|
import { ActivatedRoute } from "@angular/router";
|
|
|
|
|
|
|
|
|
|
import { AuthService } from "../auth/auth.service";
|
|
|
|
|
import { IssuesService, NotificationService, SettingsService } from "../services";
|
|
|
|
|
import { ImageService, IssuesService, NotificationService, SearchService, SettingsService } from "../services";
|
|
|
|
|
|
|
|
|
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
|
|
|
import { IIssues, IIssuesChat, IIssueSettings, INewIssueComments, IssueStatus } from "../interfaces";
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@ -22,6 +23,8 @@ export class IssueDetailsComponent implements OnInit {
|
|
|
|
|
public IssueStatus = IssueStatus;
|
|
|
|
|
public isAdmin: boolean;
|
|
|
|
|
public settings: IIssueSettings;
|
|
|
|
|
public backgroundPath: any;
|
|
|
|
|
public posterPath: any;
|
|
|
|
|
|
|
|
|
|
private issueId: number;
|
|
|
|
|
|
|
|
|
@ -29,7 +32,10 @@ export class IssueDetailsComponent implements OnInit {
|
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
|
private authService: AuthService,
|
|
|
|
|
private settingsService: SettingsService,
|
|
|
|
|
private notificationService: NotificationService) {
|
|
|
|
|
private notificationService: NotificationService,
|
|
|
|
|
private imageService: ImageService,
|
|
|
|
|
private searchService: SearchService,
|
|
|
|
|
private sanitizer: DomSanitizer) {
|
|
|
|
|
this.route.params
|
|
|
|
|
.subscribe((params: any) => {
|
|
|
|
|
this.issueId = parseInt(params.id);
|
|
|
|
@ -56,8 +62,8 @@ export class IssueDetailsComponent implements OnInit {
|
|
|
|
|
providerId: x.providerId,
|
|
|
|
|
userReported: x.userReported,
|
|
|
|
|
};
|
|
|
|
|
this.setBackground(x);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.loadComments();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -85,4 +91,24 @@ export class IssueDetailsComponent implements OnInit {
|
|
|
|
|
private loadComments() {
|
|
|
|
|
this.issueService.getComments(this.issueId).subscribe(x => this.comments = x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private setBackground(issue: any) {
|
|
|
|
|
if (issue.requestType === 1) {
|
|
|
|
|
this.searchService.getMovieInformation(Number(issue.providerId)).subscribe(x => {
|
|
|
|
|
this.backgroundPath = this.sanitizer.bypassSecurityTrustStyle
|
|
|
|
|
("url(" + "https://image.tmdb.org/t/p/w1280" + x.backdropPath + ")");
|
|
|
|
|
this.posterPath = "https://image.tmdb.org/t/p/w300/" + x.posterPath;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.imageService.getTvBanner(Number(issue.providerId)).subscribe(x => {
|
|
|
|
|
this.backgroundPath = this.sanitizer.bypassSecurityTrustStyle
|
|
|
|
|
("url(" + x + ")");
|
|
|
|
|
});
|
|
|
|
|
this.searchService.getShowInformationTreeNode(Number(issue.providerId)).subscribe(x => {
|
|
|
|
|
this.posterPath = x.data.banner;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|