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 { NgModule } from "@angular/core";
|
||||||
import { RouterModule, Routes } from "@angular/router";
|
import { RouterModule, Routes } from "@angular/router";
|
||||||
|
|
||||||
import { SearchService, RequestService } from "../services";
|
import { SearchService, RequestService, RadarrService } from "../services";
|
||||||
|
|
||||||
import {CarouselModule} from 'primeng/carousel';
|
import {CarouselModule} from 'primeng/carousel';
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ const routes: Routes = [
|
||||||
providers: [
|
providers: [
|
||||||
SearchService,
|
SearchService,
|
||||||
RequestService,
|
RequestService,
|
||||||
|
RadarrService,
|
||||||
],
|
],
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -46,6 +46,7 @@ export class MovieDetailsComponent {
|
||||||
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
|
||||||
|
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
|
if (await this.radarrService.isRadarrEnabled()) {
|
||||||
this.radarrService.getQualityProfilesFromSettings().subscribe(c => {
|
this.radarrService.getQualityProfilesFromSettings().subscribe(c => {
|
||||||
this.radarrProfiles = c;
|
this.radarrProfiles = c;
|
||||||
this.setQualityOverrides();
|
this.setQualityOverrides();
|
||||||
|
@ -55,6 +56,7 @@ export class MovieDetailsComponent {
|
||||||
this.setRootFolderOverrides();
|
this.setRootFolderOverrides();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
|
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
|
||||||
|
|
|
@ -26,4 +26,7 @@ export class RadarrService extends ServiceHelpers {
|
||||||
public getQualityProfilesFromSettings(): Observable<IRadarrProfile[]> {
|
public getQualityProfilesFromSettings(): Observable<IRadarrProfile[]> {
|
||||||
return this.http.get<IRadarrProfile[]>(`${this.url}/Profiles/`, { headers: this.headers });
|
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]
|
[Authorize]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
|
[ApiController]
|
||||||
[Produces("application/json")]
|
[Produces("application/json")]
|
||||||
public class RadarrController : Controller
|
public class RadarrController : ControllerBase
|
||||||
{
|
{
|
||||||
public RadarrController(IRadarrApi radarr, ISettingsService<RadarrSettings> settings,
|
public RadarrController(IRadarrApi radarr, ISettingsService<RadarrSettings> settings,
|
||||||
ICacheService mem)
|
ICacheService mem)
|
||||||
|
@ -39,6 +40,14 @@ namespace Ombi.Controllers.V1.External
|
||||||
return await RadarrApi.GetProfiles(settings.ApiKey, settings.FullUri);
|
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>
|
/// <summary>
|
||||||
/// Gets the Radarr root folders.
|
/// Gets the Radarr root folders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue