mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-31 03:50:08 -07:00
!wip - improve #2234 and fix build errors
This commit is contained in:
parent
196a33f087
commit
07c868711a
5 changed files with 43 additions and 41 deletions
|
@ -6,6 +6,7 @@ import { ImageService, IssuesService, NotificationService, SettingsService } fro
|
||||||
|
|
||||||
import { DomSanitizer } from "@angular/platform-browser";
|
import { DomSanitizer } from "@angular/platform-browser";
|
||||||
import { IIssues, IIssuesChat, IIssueSettings, INewIssueComments, IssueStatus } from "../interfaces";
|
import { IIssues, IIssuesChat, IIssueSettings, INewIssueComments, IssueStatus } from "../interfaces";
|
||||||
|
import { PlatformLocation } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "issueDetails.component.html",
|
templateUrl: "issueDetails.component.html",
|
||||||
|
@ -35,7 +36,8 @@ export class IssueDetailsComponent implements OnInit {
|
||||||
private settingsService: SettingsService,
|
private settingsService: SettingsService,
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private imageService: ImageService,
|
private imageService: ImageService,
|
||||||
private sanitizer: DomSanitizer) {
|
private sanitizer: DomSanitizer,
|
||||||
|
private readonly platformLocation: PlatformLocation) {
|
||||||
this.route.params
|
this.route.params
|
||||||
.subscribe((params: any) => {
|
.subscribe((params: any) => {
|
||||||
this.issueId = parseInt(params.id);
|
this.issueId = parseInt(params.id);
|
||||||
|
@ -43,13 +45,13 @@ export class IssueDetailsComponent implements OnInit {
|
||||||
|
|
||||||
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
|
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
|
||||||
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
|
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
|
||||||
this.settingsService.getOmbi().subscribe(x => {
|
|
||||||
if (x.baseUrl) {
|
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/";
|
if (base) {
|
||||||
} else {
|
this.defaultPoster = "../../.." + base + "/images/";
|
||||||
this.defaultPoster = "../../../images/";
|
} else {
|
||||||
}
|
this.defaultPoster = "../../../images/";
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
|
|
@ -6,9 +6,10 @@ import "rxjs/add/operator/map";
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject } from "rxjs/Subject";
|
||||||
|
|
||||||
import { AuthService } from "../auth/auth.service";
|
import { AuthService } from "../auth/auth.service";
|
||||||
import { NotificationService, RadarrService, RequestService, SettingsService } from "../services";
|
import { NotificationService, RadarrService, RequestService } from "../services";
|
||||||
|
|
||||||
import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder } from "../interfaces";
|
import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder } from "../interfaces";
|
||||||
|
import { PlatformLocation } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "movie-requests",
|
selector: "movie-requests",
|
||||||
|
@ -49,7 +50,7 @@ export class MovieRequestsComponent implements OnInit {
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private radarrService: RadarrService,
|
private radarrService: RadarrService,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private settingsService: SettingsService) {
|
private readonly platformLocation: PlatformLocation) {
|
||||||
this.searchChanged
|
this.searchChanged
|
||||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||||
.distinctUntilChanged() // only emit if value is different from previous value
|
.distinctUntilChanged() // only emit if value is different from previous value
|
||||||
|
@ -65,12 +66,11 @@ export class MovieRequestsComponent implements OnInit {
|
||||||
this.movieRequests = m;
|
this.movieRequests = m;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.defaultPoster = "../../../images/default_movie_poster.png"
|
this.defaultPoster = "../../../images/default_movie_poster.png";
|
||||||
this.settingsService.getOmbi().subscribe(x => {
|
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||||
if (x.baseUrl) {
|
if (base) {
|
||||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_movie_poster.png";
|
this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png";
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
|
|
@ -11,10 +11,11 @@ import "rxjs/add/operator/distinctUntilChanged";
|
||||||
import "rxjs/add/operator/map";
|
import "rxjs/add/operator/map";
|
||||||
|
|
||||||
import { AuthService } from "../auth/auth.service";
|
import { AuthService } from "../auth/auth.service";
|
||||||
import { NotificationService, RequestService, SettingsService, SonarrService } from "../services";
|
import { NotificationService, RequestService, SonarrService } from "../services";
|
||||||
|
|
||||||
import { TreeNode } from "primeng/primeng";
|
import { TreeNode } from "primeng/primeng";
|
||||||
import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces";
|
import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces";
|
||||||
|
import { PlatformLocation } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "tv-requests",
|
selector: "tv-requests",
|
||||||
|
@ -51,7 +52,7 @@ export class TvRequestsComponent implements OnInit {
|
||||||
private imageService: ImageService,
|
private imageService: ImageService,
|
||||||
private sonarrService: SonarrService,
|
private sonarrService: SonarrService,
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private settingsService: SettingsService) {
|
private readonly platformLocation: PlatformLocation) {
|
||||||
this.searchChanged
|
this.searchChanged
|
||||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||||
.distinctUntilChanged() // only emit if value is different from previous value
|
.distinctUntilChanged() // only emit if value is different from previous value
|
||||||
|
@ -68,12 +69,11 @@ export class TvRequestsComponent implements OnInit {
|
||||||
this.tvRequests.forEach((val) => this.setOverride(val.data));
|
this.tvRequests.forEach((val) => this.setOverride(val.data));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.defaultPoster = "../../../images/default_tv_poster.png"
|
this.defaultPoster = "../../../images/default_tv_poster.png";
|
||||||
this.settingsService.getOmbi().subscribe(x => {
|
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||||
if (x.baseUrl) {
|
if (base) {
|
||||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_tv_poster.png";
|
this.defaultPoster = "../../.." + base + "/images/default_tv_poster.png";
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public openClosestTab(el: any) {
|
public openClosestTab(el: any) {
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { Subject } from "rxjs/Subject";
|
||||||
|
|
||||||
import { AuthService } from "../auth/auth.service";
|
import { AuthService } from "../auth/auth.service";
|
||||||
import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces";
|
import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces";
|
||||||
import { NotificationService, RequestService, SearchService, SettingsService } from "../services";
|
import { NotificationService, RequestService, SearchService } from "../services";
|
||||||
|
import { PlatformLocation } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "movie-search",
|
selector: "movie-search",
|
||||||
|
@ -33,8 +34,8 @@ export class MovieSearchComponent implements OnInit {
|
||||||
|
|
||||||
constructor(private searchService: SearchService, private requestService: RequestService,
|
constructor(private searchService: SearchService, private requestService: RequestService,
|
||||||
private notificationService: NotificationService, private authService: AuthService,
|
private notificationService: NotificationService, private authService: AuthService,
|
||||||
private readonly translate: TranslateService, private sanitizer: DomSanitizer,
|
private readonly translate: TranslateService, private sanitizer: DomSanitizer,
|
||||||
private settingsService: SettingsService) {
|
private readonly platformLocation: PlatformLocation) {
|
||||||
|
|
||||||
this.searchChanged
|
this.searchChanged
|
||||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||||
|
@ -54,12 +55,11 @@ export class MovieSearchComponent implements OnInit {
|
||||||
this.getExtraInfo();
|
this.getExtraInfo();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.defaultPoster = "../../../images/default_movie_poster.png"
|
this.defaultPoster = "../../../images/default_movie_poster.png";
|
||||||
this.settingsService.getOmbi().subscribe(x => {
|
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||||
if (x.baseUrl) {
|
if (base) {
|
||||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_movie_poster.png";
|
this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png";
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
|
|
@ -3,11 +3,12 @@ import { DomSanitizer } from "@angular/platform-browser";
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject } from "rxjs/Subject";
|
||||||
|
|
||||||
import { AuthService } from "../auth/auth.service";
|
import { AuthService } from "../auth/auth.service";
|
||||||
import { ImageService, NotificationService, RequestService, SearchService, SettingsService } from "../services";
|
import { ImageService, NotificationService, RequestService, SearchService } from "../services";
|
||||||
|
|
||||||
import { TreeNode } from "primeng/primeng";
|
import { TreeNode } from "primeng/primeng";
|
||||||
import { IRequestEngineResult } from "../interfaces";
|
import { IRequestEngineResult } from "../interfaces";
|
||||||
import { IIssueCategory, ISearchTvResult, ISeasonsViewModel, ITvRequestViewModel } from "../interfaces";
|
import { IIssueCategory, ISearchTvResult, ISeasonsViewModel, ITvRequestViewModel } from "../interfaces";
|
||||||
|
import { PlatformLocation } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "tv-search",
|
selector: "tv-search",
|
||||||
|
@ -34,7 +35,7 @@ export class TvSearchComponent implements OnInit {
|
||||||
constructor(private searchService: SearchService, private requestService: RequestService,
|
constructor(private searchService: SearchService, private requestService: RequestService,
|
||||||
private notificationService: NotificationService, private authService: AuthService,
|
private notificationService: NotificationService, private authService: AuthService,
|
||||||
private imageService: ImageService, private sanitizer: DomSanitizer,
|
private imageService: ImageService, private sanitizer: DomSanitizer,
|
||||||
private settingsService: SettingsService) {
|
private readonly platformLocation: PlatformLocation) {
|
||||||
|
|
||||||
this.searchChanged
|
this.searchChanged
|
||||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||||
|
@ -52,12 +53,11 @@ export class TvSearchComponent implements OnInit {
|
||||||
this.getExtraInfo();
|
this.getExtraInfo();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.defaultPoster = "../../../images/default_tv_poster.png"
|
this.defaultPoster = "../../../images/default_tv_poster.png";
|
||||||
this.settingsService.getOmbi().subscribe(x => {
|
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||||
if (x.baseUrl) {
|
if(base) {
|
||||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_tv_poster.png";
|
this.defaultPoster = "../../.." + base + "/images/default_tv_poster.png";
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
public openClosestTab(el: any) {
|
public openClosestTab(el: any) {
|
||||||
el.preventDefault();
|
el.preventDefault();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue