Fixed the movies page

pull/3895/head
Jamie Rees 6 years ago
parent cc5fb56e7b
commit e418cbae57

@ -1,7 +1,7 @@
import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
import { SearchService, RequestService } from "../services";
import { SearchService, RequestService, RadarrService } from "../services";
import {CarouselModule} from 'primeng/carousel';
@ -41,6 +41,7 @@ const routes: Routes = [
providers: [
SearchService,
RequestService,
RadarrService,
],
})

@ -46,6 +46,7 @@ export class MovieDetailsComponent {
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
if (this.isAdmin) {
if (await this.radarrService.isRadarrEnabled()) {
this.radarrService.getQualityProfilesFromSettings().subscribe(c => {
this.radarrProfiles = c;
this.setQualityOverrides();
@ -55,6 +56,7 @@ export class MovieDetailsComponent {
this.setRootFolderOverrides();
});
}
}
}
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {

@ -26,4 +26,7 @@ export class RadarrService extends ServiceHelpers {
public getQualityProfilesFromSettings(): Observable<IRadarrProfile[]> {
return this.http.get<IRadarrProfile[]>(`${this.url}/Profiles/`, { headers: this.headers });
}
public isRadarrEnabled(): Promise<boolean> {
return this.http.get<boolean>(`${this.url}/enabled/`, { headers: this.headers }).toPromise();
}
}

@ -13,8 +13,9 @@ namespace Ombi.Controllers.V1.External
{
[Authorize]
[ApiV1]
[ApiController]
[Produces("application/json")]
public class RadarrController : Controller
public class RadarrController : ControllerBase
{
public RadarrController(IRadarrApi radarr, ISettingsService<RadarrSettings> settings,
ICacheService mem)
@ -39,6 +40,14 @@ namespace Ombi.Controllers.V1.External
return await RadarrApi.GetProfiles(settings.ApiKey, settings.FullUri);
}
[HttpGet("enabled")]
[PowerUser]
public async Task<bool> Enabled()
{
var settings = await RadarrSettings.GetSettingsAsync();
return settings.Enabled;
}
/// <summary>
/// Gets the Radarr root folders.
/// </summary>

Loading…
Cancel
Save