mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
fix #2234
This commit is contained in:
parent
3b9454258b
commit
196a33f087
5 changed files with 55 additions and 15 deletions
|
@ -25,7 +25,8 @@ export class IssueDetailsComponent implements OnInit {
|
|||
public settings: IIssueSettings;
|
||||
public backgroundPath: any;
|
||||
public posterPath: any;
|
||||
|
||||
public defaultPoster: string;
|
||||
|
||||
private issueId: number;
|
||||
|
||||
constructor(private issueService: IssuesService,
|
||||
|
@ -42,6 +43,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/";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
|
@ -99,7 +107,7 @@ export class IssueDetailsComponent implements OnInit {
|
|||
});
|
||||
this.imageService.getMoviePoster(issue.providerId).subscribe(x => {
|
||||
if (x.length === 0) {
|
||||
this.posterPath = "../../../images/default_movie_poster.png";
|
||||
this.posterPath = this.defaultPoster + "default_movie_poster.png";
|
||||
} else {
|
||||
this.posterPath = x.toString();
|
||||
}
|
||||
|
@ -112,7 +120,7 @@ export class IssueDetailsComponent implements OnInit {
|
|||
});
|
||||
this.imageService.getTvPoster(Number(issue.providerId)).subscribe(x => {
|
||||
if (x.length === 0) {
|
||||
this.posterPath = "../../../images/default_tv_poster.png";
|
||||
this.posterPath = this.defaultPoster + "default_tv_poster.png";
|
||||
} else {
|
||||
this.posterPath = x.toString();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import "rxjs/add/operator/map";
|
|||
import { Subject } from "rxjs/Subject";
|
||||
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
import { NotificationService, RadarrService, RequestService } from "../services";
|
||||
import { NotificationService, RadarrService, RequestService, SettingsService } from "../services";
|
||||
|
||||
import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder } from "../interfaces";
|
||||
|
||||
|
@ -16,6 +16,7 @@ import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadar
|
|||
})
|
||||
export class MovieRequestsComponent implements OnInit {
|
||||
public movieRequests: IMovieRequests[];
|
||||
public defaultPoster: string;
|
||||
|
||||
public searchChanged: Subject<string> = new Subject<string>();
|
||||
public searchText: string;
|
||||
|
@ -47,7 +48,8 @@ export class MovieRequestsComponent implements OnInit {
|
|||
private auth: AuthService,
|
||||
private notificationService: NotificationService,
|
||||
private radarrService: RadarrService,
|
||||
private sanitizer: DomSanitizer) {
|
||||
private sanitizer: DomSanitizer,
|
||||
private settingsService: SettingsService) {
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
.distinctUntilChanged() // only emit if value is different from previous value
|
||||
|
@ -63,6 +65,12 @@ 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";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
|
@ -354,7 +362,7 @@ export class MovieRequestsComponent implements OnInit {
|
|||
|
||||
private setPoster(req: IMovieRequests): void {
|
||||
if (req.posterPath === null) {
|
||||
req.posterPath = "../../../images/default_movie_poster.png";
|
||||
req.posterPath = this.defaultPoster;
|
||||
} else {
|
||||
req.posterPath = "https://image.tmdb.org/t/p/w300/" + req.posterPath;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import "rxjs/add/operator/distinctUntilChanged";
|
|||
import "rxjs/add/operator/map";
|
||||
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
import { NotificationService, RequestService, SonarrService } from "../services";
|
||||
import { NotificationService, RequestService, SettingsService, SonarrService } from "../services";
|
||||
|
||||
import { TreeNode } from "primeng/primeng";
|
||||
import { IIssueCategory, IPagenator, ISonarrProfile, ISonarrRootFolder, ITvRequests } from "../interfaces";
|
||||
|
@ -29,6 +29,7 @@ export class TvRequestsComponent implements OnInit {
|
|||
public isAdmin: boolean;
|
||||
public showChildDialogue = false; // This is for the child modal popup
|
||||
public selectedSeason: ITvRequests;
|
||||
public defaultPoster: string;
|
||||
|
||||
@Input() public issueCategories: IIssueCategory[];
|
||||
@Input() public issuesEnabled: boolean;
|
||||
|
@ -49,7 +50,8 @@ export class TvRequestsComponent implements OnInit {
|
|||
private sanitizer: DomSanitizer,
|
||||
private imageService: ImageService,
|
||||
private sonarrService: SonarrService,
|
||||
private notificationService: NotificationService) {
|
||||
private notificationService: NotificationService,
|
||||
private settingsService: SettingsService) {
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
.distinctUntilChanged() // only emit if value is different from previous value
|
||||
|
@ -66,6 +68,12 @@ 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";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public openClosestTab(el: any) {
|
||||
|
@ -222,7 +230,7 @@ export class TvRequestsComponent implements OnInit {
|
|||
|
||||
private setDefaults(val: any) {
|
||||
if (val.data.posterPath === null) {
|
||||
val.data.posterPath = "../../../images/default_tv_poster.png";
|
||||
val.data.posterPath = this.defaultPoster;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Subject } from "rxjs/Subject";
|
|||
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
import { IIssueCategory, IRequestEngineResult, ISearchMovieResult } from "../interfaces";
|
||||
import { NotificationService, RequestService, SearchService } from "../services";
|
||||
import { NotificationService, RequestService, SearchService, SettingsService } from "../services";
|
||||
|
||||
@Component({
|
||||
selector: "movie-search",
|
||||
|
@ -29,10 +29,12 @@ export class MovieSearchComponent implements OnInit {
|
|||
public issueRequestId: number;
|
||||
public issueProviderId: string;
|
||||
public issueCategorySelected: IIssueCategory;
|
||||
public defaultPoster: string;
|
||||
|
||||
constructor(private searchService: SearchService, private requestService: RequestService,
|
||||
private notificationService: NotificationService, private authService: AuthService,
|
||||
private readonly translate: TranslateService, private sanitizer: DomSanitizer) {
|
||||
private readonly translate: TranslateService, private sanitizer: DomSanitizer,
|
||||
private settingsService: SettingsService) {
|
||||
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
|
@ -52,6 +54,12 @@ 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";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
|
@ -159,7 +167,7 @@ export class MovieSearchComponent implements OnInit {
|
|||
|
||||
this.movieResults.forEach((val, index) => {
|
||||
if (val.posterPath === null) {
|
||||
val.posterPath = "../../../images/default_movie_poster.png";
|
||||
val.posterPath = this.defaultPoster;
|
||||
} else {
|
||||
val.posterPath = "https://image.tmdb.org/t/p/w300/" + val.posterPath;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { DomSanitizer } from "@angular/platform-browser";
|
|||
import { Subject } from "rxjs/Subject";
|
||||
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
import { ImageService, NotificationService, RequestService, SearchService} from "../services";
|
||||
import { ImageService, NotificationService, RequestService, SearchService, SettingsService } from "../services";
|
||||
|
||||
import { TreeNode } from "primeng/primeng";
|
||||
import { IRequestEngineResult } from "../interfaces";
|
||||
|
@ -21,6 +21,7 @@ export class TvSearchComponent implements OnInit {
|
|||
public tvResults: TreeNode[];
|
||||
public result: IRequestEngineResult;
|
||||
public searchApplied = false;
|
||||
public defaultPoster: string;
|
||||
|
||||
@Input() public issueCategories: IIssueCategory[];
|
||||
@Input() public issuesEnabled: boolean;
|
||||
|
@ -32,7 +33,8 @@ 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 imageService: ImageService, private sanitizer: DomSanitizer,
|
||||
private settingsService: SettingsService) {
|
||||
|
||||
this.searchChanged
|
||||
.debounceTime(600) // Wait Xms after the last event before emitting last event
|
||||
|
@ -50,6 +52,12 @@ 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";
|
||||
}
|
||||
});
|
||||
}
|
||||
public openClosestTab(el: any) {
|
||||
el.preventDefault();
|
||||
|
@ -228,7 +236,7 @@ export class TvSearchComponent implements OnInit {
|
|||
|
||||
private setDefaults(x: any) {
|
||||
if (x.data.banner === null) {
|
||||
x.data.banner = "../../../images/default_tv_poster.png";
|
||||
x.data.banner = this.defaultPoster;
|
||||
}
|
||||
|
||||
if (x.data.imdbId === null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue