mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Fixed the movies page
This commit is contained in:
parent
cc5fb56e7b
commit
e418cbae57
4 changed files with 34 additions and 19 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue