diff --git a/src/Ombi/ClientApp/src/app/login/resetpassword.component.ts b/src/Ombi/ClientApp/src/app/login/resetpassword.component.ts
index 97d8e88f98..bd0376cb1b 100644
--- a/src/Ombi/ClientApp/src/app/login/resetpassword.component.ts
+++ b/src/Ombi/ClientApp/src/app/login/resetpassword.component.ts
@@ -1,16 +1,14 @@
-import { PlatformLocation, APP_BASE_HREF } from "@angular/common";
+import { APP_BASE_HREF } from "@angular/common";
import { Component, OnInit, Inject } from "@angular/core";
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
-import { DomSanitizer } from "@angular/platform-browser";
import { fadeInOutAnimation } from "../animations/fadeinout";
import { ICustomizationSettings } from "../interfaces";
-import { IdentityService, ImageService, NotificationService, SettingsService } from "../services";
+import { IdentityService, NotificationService, SettingsService } from "../services";
import { CustomizationFacade } from "../state/customization";
@Component({
templateUrl: "./resetpassword.component.html",
- animations: [fadeInOutAnimation],
styleUrls: ["./login.component.scss"],
})
export class ResetPasswordComponent implements OnInit {
@@ -19,12 +17,11 @@ export class ResetPasswordComponent implements OnInit {
public customizationSettings: ICustomizationSettings;
public emailSettingsEnabled: boolean;
public baseUrl: string;
- public background: any;
private href: string;
constructor(private identityService: IdentityService, private notify: NotificationService,
private fb: UntypedFormBuilder, private settingsService: SettingsService, @Inject(APP_BASE_HREF) href:string,
- private images: ImageService, private sanitizer: DomSanitizer, private customizationFacade: CustomizationFacade) {
+ private customizationFacade: CustomizationFacade) {
this.href = href;
this.form = this.fb.group({
email: ["", [Validators.required]],
@@ -32,9 +29,7 @@ export class ResetPasswordComponent implements OnInit {
}
public ngOnInit() {
- this.images.getRandomBackground().subscribe(x => {
- this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%),url(" + x.url + ")");
- });
+
const base = this.href;
if (base.length > 1) {
this.baseUrl = base;
diff --git a/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.html b/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.html
index 6a1c2567f3..bd8bc3e386 100644
--- a/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.html
+++ b/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.html
@@ -1,11 +1,7 @@
-
-
+
-
+
OMBI
= 7 && customizationSettings.applicationName.length < 14, 'hugeText': customizationSettings.applicationName.length >= 14 }" class="login_logo custom">{{customizationSettings.applicationName}}
@@ -13,7 +9,7 @@
The passwords do not match
-
+
The Password is required
The Email is required
The Confirm Password is required
@@ -41,16 +37,14 @@
required
-
-
-
+
-
-
+
+
-
+
diff --git a/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.ts b/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.ts
index 590c233f98..b7ef08281d 100644
--- a/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.ts
+++ b/src/Ombi/ClientApp/src/app/login/tokenresetpassword.component.ts
@@ -1,10 +1,9 @@
import { ActivatedRoute, Params } from "@angular/router";
import { Component, OnInit } from "@angular/core";
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
-import { IdentityService, ImageService } from "../services";
+import { IdentityService } from "../services";
import { CustomizationFacade } from "../state/customization";
-import { DomSanitizer } from "@angular/platform-browser";
import { ICustomizationSettings } from "../interfaces";
import { IResetPasswordToken } from "../interfaces";
import { NotificationService } from "../services";
@@ -19,13 +18,10 @@ export class TokenResetPasswordComponent implements OnInit {
public form: UntypedFormGroup;
public customizationSettings: ICustomizationSettings;
- public background: any;
public baseUrl: string;
constructor(private identityService: IdentityService, private router: Router, private route: ActivatedRoute, private notify: NotificationService,
- private fb: UntypedFormBuilder, private location: PlatformLocation, private images: ImageService,
- private sanitizer: DomSanitizer, private customizationFacade: CustomizationFacade,
- ) {
+ private fb: UntypedFormBuilder, private location: PlatformLocation, private customizationFacade: CustomizationFacade) {
this.route.queryParams
.subscribe((params: Params) => {
@@ -39,9 +35,6 @@ export class TokenResetPasswordComponent implements OnInit {
}
public ngOnInit() {
- this.images.getRandomBackground().subscribe(x => {
- this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%),url(" + x.url + ")");
- });
const base = this.location.getBaseHrefFromDOM();
if (base.length > 1) {
this.baseUrl = base;
@@ -65,6 +58,5 @@ export class TokenResetPasswordComponent implements OnInit {
});
}
});
-
}
}
diff --git a/src/Ombi/ClientApp/src/app/services/image.service.ts b/src/Ombi/ClientApp/src/app/services/image.service.ts
index 521a207e36..c46876d733 100644
--- a/src/Ombi/ClientApp/src/app/services/image.service.ts
+++ b/src/Ombi/ClientApp/src/app/services/image.service.ts
@@ -1,10 +1,10 @@
-import { PlatformLocation, APP_BASE_HREF } from "@angular/common";
+import { APP_BASE_HREF } from "@angular/common";
import { Injectable, Inject } from "@angular/core";
import { Observable } from "rxjs";
import { HttpClient } from "@angular/common/http";
-import { IImages } from "../interfaces";
+import { IImages, IImagesInfo } from "../interfaces";
import { ServiceHelpers } from "./service.helpers";
@Injectable()
@@ -17,6 +17,10 @@ export class ImageService extends ServiceHelpers {
return this.http.get
(`${this.url}background/`, {headers: this.headers});
}
+ public getRandomBackgroundWithInfo(): Observable {
+ return this.http.get(`${this.url}background/info`, {headers: this.headers});
+ }
+
public getTvBanner(tvdbid: number): Observable {
return this.http.get(`${this.url}tv/${tvdbid}`, {headers: this.headers});
}
@@ -31,8 +35,9 @@ export class ImageService extends ServiceHelpers {
public getMovieBackground(movieDbId: string): Observable {
return this.http.get(`${this.url}background/movie/${movieDbId}`, { headers: this.headers });
- }
- public getMovieBanner(movieDbId: string): Observable {
+ }
+
+ public getMovieBanner(movieDbId: string): Observable {
return this.http.get(`${this.url}banner/movie/${movieDbId}`, { headers: this.headers });
}
diff --git a/src/Ombi/Controllers/V1/ImagesController.cs b/src/Ombi/Controllers/V1/ImagesController.cs
index 9683c54b0d..0b8a6ce4c2 100644
--- a/src/Ombi/Controllers/V1/ImagesController.cs
+++ b/src/Ombi/Controllers/V1/ImagesController.cs
@@ -45,9 +45,9 @@ public async Task GetTvBanner(int tvdbid)
{
return string.Empty;
}
- var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
+ var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
- var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}tv{tvdbid}", () => FanartTvApi.GetTvImages(tvdbid, key.Value), DateTimeOffset.Now.AddDays(1));
+ var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}tv{tvdbid}", () => FanartTvApi.GetTvImages(tvdbid, key.Value), DateTimeOffset.Now.AddDays(1));
if (images == null)
{
return string.Empty;
@@ -70,16 +70,16 @@ public async Task GetTvBanner(int tvdbid)
[HttpGet("poster")]
public async Task GetRandomPoster()
{
- var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
+ var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
var rand = new Random();
var val = rand.Next(1, 3);
if (val == 1)
{
- var movies = (await _movieEngineV2.PopularMovies(0, 10, HttpContext.RequestAborted ,"en")).ToArray();
+ var movies = (await _movieEngineV2.PopularMovies(0, 10, HttpContext.RequestAborted, "en")).ToArray();
var selectedMovieIndex = rand.Next(movies.Count());
var movie = movies[selectedMovieIndex];
- var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movie.Id}", () => FanartTvApi.GetMovieImages(movie.Id.ToString(), key.Value), DateTimeOffset.Now.AddDays(1));
+ var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movie.Id}", () => FanartTvApi.GetMovieImages(movie.Id.ToString(), key.Value), DateTimeOffset.Now.AddDays(1));
if (images == null)
{
return string.Empty;
@@ -99,7 +99,7 @@ public async Task GetRandomPoster()
{
return images.moviethumb.OrderBy(x => x.likes).Select(x => x.url).FirstOrDefault();
}
- }
+ }
else
{
var tv = (await _tvSearchEngineV2.Popular(0, 10, "en")).ToArray();
@@ -114,9 +114,9 @@ public async Task GetRandomPoster()
[HttpGet("poster/movie/{movieDbId}")]
public async Task GetMoviePoster(string movieDbId)
{
- var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
+ var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
- var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movieDbId}", () => FanartTvApi.GetMovieImages(movieDbId, key.Value), DateTimeOffset.Now.AddDays(1));
+ var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movieDbId}", () => FanartTvApi.GetMovieImages(movieDbId, key.Value), DateTimeOffset.Now.AddDays(1));
if (images == null)
{
@@ -148,9 +148,9 @@ public async Task GetTvPoster(int tvdbid)
{
return string.Empty;
}
- var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
+ var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
- var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}tv{tvdbid}", () => FanartTvApi.GetTvImages(tvdbid, key.Value), DateTimeOffset.Now.AddDays(1));
+ var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}tv{tvdbid}", () => FanartTvApi.GetTvImages(tvdbid, key.Value), DateTimeOffset.Now.AddDays(1));
if (images == null)
{
@@ -178,10 +178,10 @@ public async Task GetTvPoster(int tvdbid)
[HttpGet("background/movie/{movieDbId}")]
public async Task GetMovieBackground(string movieDbId)
{
- var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
+ var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
+
+ var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movieDbId}", () => FanartTvApi.GetMovieImages(movieDbId, key.Value), DateTimeOffset.Now.AddDays(1));
- var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movieDbId}", () => FanartTvApi.GetMovieImages(movieDbId, key.Value), DateTimeOffset.Now.AddDays(1));
-
if (images == null)
{
return string.Empty;
@@ -203,9 +203,9 @@ public async Task GetMovieBackground(string movieDbId)
[HttpGet("banner/movie/{movieDbId}")]
public async Task GetMovieBanner(string movieDbId)
{
- var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
+ var key = await _cache.GetOrAddAsync(CacheKeys.FanartTv, () => Config.GetAsync(Store.Entities.ConfigurationTypes.FanartTv), DateTimeOffset.Now.AddDays(1));
- var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movieDbId}", () => FanartTvApi.GetMovieImages(movieDbId, key.Value), DateTimeOffset.Now.AddDays(1));
+ var images = await _cache.GetOrAddAsync($"{CacheKeys.FanartTv}movie{movieDbId}", () => FanartTvApi.GetMovieImages(movieDbId, key.Value), DateTimeOffset.Now.AddDays(1));
if (images == null)
{
@@ -246,34 +246,34 @@ public async Task