mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -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 { IIssues, IIssuesChat, IIssueSettings, INewIssueComments, IssueStatus } from "../interfaces";
|
||||
import { PlatformLocation } from "@angular/common";
|
||||
|
||||
@Component({
|
||||
templateUrl: "issueDetails.component.html",
|
||||
|
@ -35,7 +36,8 @@ export class IssueDetailsComponent implements OnInit {
|
|||
private settingsService: SettingsService,
|
||||
private notificationService: NotificationService,
|
||||
private imageService: ImageService,
|
||||
private sanitizer: DomSanitizer) {
|
||||
private sanitizer: DomSanitizer,
|
||||
private readonly platformLocation: PlatformLocation) {
|
||||
this.route.params
|
||||
.subscribe((params: any) => {
|
||||
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.settingsService.getIssueSettings().subscribe(x => this.settings = x);
|
||||
this.settingsService.getOmbi().subscribe(x => {
|
||||
if (x.baseUrl) {
|
||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/";
|
||||
} else {
|
||||
this.defaultPoster = "../../../images/";
|
||||
}
|
||||
});
|
||||
|
||||
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||
if (base) {
|
||||
this.defaultPoster = "../../.." + base + "/images/";
|
||||
} else {
|
||||
this.defaultPoster = "../../../images/";
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
|
|
|
@ -6,9 +6,10 @@ import "rxjs/add/operator/map";
|
|||
import { Subject } from "rxjs/Subject";
|
||||
|
||||
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 { PlatformLocation } from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: "movie-requests",
|
||||
|
@ -49,7 +50,7 @@ export class MovieRequestsComponent implements OnInit {
|
|||
private notificationService: NotificationService,
|
||||
private radarrService: RadarrService,
|
||||
private sanitizer: DomSanitizer,
|
||||
private settingsService: SettingsService) {
|
||||
private readonly platformLocation: PlatformLocation) {
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
.distinctUntilChanged() // only emit if value is different from previous value
|
||||
|
@ -65,12 +66,11 @@ export class MovieRequestsComponent implements OnInit {
|
|||
this.movieRequests = m;
|
||||
});
|
||||
});
|
||||
this.defaultPoster = "../../../images/default_movie_poster.png"
|
||||
this.settingsService.getOmbi().subscribe(x => {
|
||||
if (x.baseUrl) {
|
||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_movie_poster.png";
|
||||
}
|
||||
});
|
||||
this.defaultPoster = "../../../images/default_movie_poster.png";
|
||||
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||
if (base) {
|
||||
this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png";
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
|
|
|
@ -11,10 +11,11 @@ import "rxjs/add/operator/distinctUntilChanged";
|
|||
import "rxjs/add/operator/map";
|
||||
|
||||
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 { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces";
|
||||
import { PlatformLocation } from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: "tv-requests",
|
||||
|
@ -51,7 +52,7 @@ export class TvRequestsComponent implements OnInit {
|
|||
private imageService: ImageService,
|
||||
private sonarrService: SonarrService,
|
||||
private notificationService: NotificationService,
|
||||
private settingsService: SettingsService) {
|
||||
private readonly platformLocation: PlatformLocation) {
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
.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.defaultPoster = "../../../images/default_tv_poster.png"
|
||||
this.settingsService.getOmbi().subscribe(x => {
|
||||
if (x.baseUrl) {
|
||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_tv_poster.png";
|
||||
}
|
||||
});
|
||||
this.defaultPoster = "../../../images/default_tv_poster.png";
|
||||
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||
if (base) {
|
||||
this.defaultPoster = "../../.." + base + "/images/default_tv_poster.png";
|
||||
}
|
||||
}
|
||||
|
||||
public openClosestTab(el: any) {
|
||||
|
|
|
@ -8,7 +8,8 @@ import { Subject } from "rxjs/Subject";
|
|||
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
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({
|
||||
selector: "movie-search",
|
||||
|
@ -33,8 +34,8 @@ export class MovieSearchComponent implements OnInit {
|
|||
|
||||
constructor(private searchService: SearchService, private requestService: RequestService,
|
||||
private notificationService: NotificationService, private authService: AuthService,
|
||||
private readonly translate: TranslateService, private sanitizer: DomSanitizer,
|
||||
private settingsService: SettingsService) {
|
||||
private readonly translate: TranslateService, private sanitizer: DomSanitizer,
|
||||
private readonly platformLocation: PlatformLocation) {
|
||||
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
|
@ -54,12 +55,11 @@ export class MovieSearchComponent implements OnInit {
|
|||
this.getExtraInfo();
|
||||
});
|
||||
});
|
||||
this.defaultPoster = "../../../images/default_movie_poster.png"
|
||||
this.settingsService.getOmbi().subscribe(x => {
|
||||
if (x.baseUrl) {
|
||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_movie_poster.png";
|
||||
}
|
||||
});
|
||||
this.defaultPoster = "../../../images/default_movie_poster.png";
|
||||
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||
if (base) {
|
||||
this.defaultPoster = "../../.." + base + "/images/default_movie_poster.png";
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
|
|
|
@ -3,11 +3,12 @@ import { DomSanitizer } from "@angular/platform-browser";
|
|||
import { Subject } from "rxjs/Subject";
|
||||
|
||||
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 { IRequestEngineResult } from "../interfaces";
|
||||
import { IIssueCategory, ISearchTvResult, ISeasonsViewModel, ITvRequestViewModel } from "../interfaces";
|
||||
import { PlatformLocation } from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: "tv-search",
|
||||
|
@ -34,7 +35,7 @@ export class TvSearchComponent implements OnInit {
|
|||
constructor(private searchService: SearchService, private requestService: RequestService,
|
||||
private notificationService: NotificationService, private authService: AuthService,
|
||||
private imageService: ImageService, private sanitizer: DomSanitizer,
|
||||
private settingsService: SettingsService) {
|
||||
private readonly platformLocation: PlatformLocation) {
|
||||
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
|
@ -52,12 +53,11 @@ export class TvSearchComponent implements OnInit {
|
|||
this.getExtraInfo();
|
||||
});
|
||||
});
|
||||
this.defaultPoster = "../../../images/default_tv_poster.png"
|
||||
this.settingsService.getOmbi().subscribe(x => {
|
||||
if (x.baseUrl) {
|
||||
this.defaultPoster = "../../.." + x.baseUrl + "/images/default_tv_poster.png";
|
||||
}
|
||||
});
|
||||
this.defaultPoster = "../../../images/default_tv_poster.png";
|
||||
const base = this.platformLocation.getBaseHrefFromDOM();
|
||||
if(base) {
|
||||
this.defaultPoster = "../../.." + base + "/images/default_tv_poster.png";
|
||||
}
|
||||
}
|
||||
public openClosestTab(el: any) {
|
||||
el.preventDefault();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue