mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
fix(radarr-4k): 🐛 Fixed an issue when using Radarr 4k with user set quality profiles. There are now user quality profiles for 4k profile #5025
This commit is contained in:
parent
d0744ce87b
commit
62b9a1f65f
14 changed files with 21612 additions and 13919 deletions
|
@ -69,7 +69,7 @@ namespace Ombi.Core.Senders
|
||||||
}
|
}
|
||||||
if (radarrSettings.Enabled)
|
if (radarrSettings.Enabled)
|
||||||
{
|
{
|
||||||
return await SendToRadarr(model, radarrSettings);
|
return await SendToRadarr(model, radarrSettings, is4K);
|
||||||
}
|
}
|
||||||
|
|
||||||
var dogSettings = await _dogNzbSettings.GetSettingsAsync();
|
var dogSettings = await _dogNzbSettings.GetSettingsAsync();
|
||||||
|
@ -133,7 +133,7 @@ namespace Ombi.Core.Senders
|
||||||
return await _dogNzbApi.AddMovie(settings.ApiKey, id);
|
return await _dogNzbApi.AddMovie(settings.ApiKey, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<SenderResult> SendToRadarr(MovieRequests model, RadarrSettings settings)
|
private async Task<SenderResult> SendToRadarr(MovieRequests model, RadarrSettings settings, bool is4k)
|
||||||
{
|
{
|
||||||
var qualityToUse = int.Parse(settings.DefaultQualityProfile);
|
var qualityToUse = int.Parse(settings.DefaultQualityProfile);
|
||||||
|
|
||||||
|
@ -141,6 +141,23 @@ namespace Ombi.Core.Senders
|
||||||
|
|
||||||
var profiles = await _userProfiles.GetAll().FirstOrDefaultAsync(x => x.UserId == model.RequestedUserId);
|
var profiles = await _userProfiles.GetAll().FirstOrDefaultAsync(x => x.UserId == model.RequestedUserId);
|
||||||
if (profiles != null)
|
if (profiles != null)
|
||||||
|
{
|
||||||
|
if (is4k)
|
||||||
|
{
|
||||||
|
if (profiles.Radarr4KRootPath > 0)
|
||||||
|
{
|
||||||
|
var tempPath = await RadarrRootPath(profiles.Radarr4KRootPath, settings);
|
||||||
|
if (tempPath.HasValue())
|
||||||
|
{
|
||||||
|
rootFolderPath = tempPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (profiles.Radarr4KQualityProfile > 0)
|
||||||
|
{
|
||||||
|
qualityToUse = profiles.Radarr4KQualityProfile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (profiles.RadarrRootPath > 0)
|
if (profiles.RadarrRootPath > 0)
|
||||||
{
|
{
|
||||||
|
@ -155,6 +172,7 @@ namespace Ombi.Core.Senders
|
||||||
qualityToUse = profiles.RadarrQualityProfile;
|
qualityToUse = profiles.RadarrQualityProfile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var tags = new List<int>();
|
var tags = new List<int>();
|
||||||
if (settings.Tag.HasValue)
|
if (settings.Tag.HasValue)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Ombi.Helpers;
|
|
||||||
|
|
||||||
namespace Ombi.Store.Entities
|
namespace Ombi.Store.Entities
|
||||||
{
|
{
|
||||||
|
@ -15,6 +14,8 @@ namespace Ombi.Store.Entities
|
||||||
public int SonarrQualityProfile { get; set; }
|
public int SonarrQualityProfile { get; set; }
|
||||||
public int RadarrRootPath { get; set; }
|
public int RadarrRootPath { get; set; }
|
||||||
public int RadarrQualityProfile { get; set; }
|
public int RadarrQualityProfile { get; set; }
|
||||||
|
public int Radarr4KRootPath { get; set; }
|
||||||
|
public int Radarr4KQualityProfile { get; set; }
|
||||||
|
|
||||||
[ForeignKey(nameof(UserId))]
|
[ForeignKey(nameof(UserId))]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
1308
src/Ombi.Store/Migrations/OmbiMySql/20231118220121_Radarr4kUserQualityProfile.Designer.cs
generated
Normal file
1308
src/Ombi.Store/Migrations/OmbiMySql/20231118220121_Radarr4kUserQualityProfile.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,37 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Ombi.Store.Migrations.OmbiMySql
|
||||||
|
{
|
||||||
|
public partial class Radarr4kUserQualityProfile : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Radarr4KQualityProfile",
|
||||||
|
table: "UserQualityProfiles",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Radarr4KRootPath",
|
||||||
|
table: "UserQualityProfiles",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Radarr4KQualityProfile",
|
||||||
|
table: "UserQualityProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Radarr4KRootPath",
|
||||||
|
table: "UserQualityProfiles");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -923,6 +923,12 @@ namespace Ombi.Store.Migrations.OmbiMySql
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Radarr4KQualityProfile")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Radarr4KRootPath")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<int>("RadarrQualityProfile")
|
b.Property<int>("RadarrQualityProfile")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
|
1306
src/Ombi.Store/Migrations/OmbiSqlite/20231118214929_Radarr4kUserQualityProfile.Designer.cs
generated
Normal file
1306
src/Ombi.Store/Migrations/OmbiSqlite/20231118214929_Radarr4kUserQualityProfile.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,37 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Ombi.Store.Migrations.OmbiSqlite
|
||||||
|
{
|
||||||
|
public partial class Radarr4kUserQualityProfile : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Radarr4KQualityProfile",
|
||||||
|
table: "UserQualityProfiles",
|
||||||
|
type: "INTEGER",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Radarr4KRootPath",
|
||||||
|
table: "UserQualityProfiles",
|
||||||
|
type: "INTEGER",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Radarr4KQualityProfile",
|
||||||
|
table: "UserQualityProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Radarr4KRootPath",
|
||||||
|
table: "UserQualityProfiles");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -921,6 +921,12 @@ namespace Ombi.Store.Migrations.OmbiSqlite
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<int>("Radarr4KQualityProfile")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<int>("Radarr4KRootPath")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<int>("RadarrQualityProfile")
|
b.Property<int>("RadarrQualityProfile")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,8 @@ export interface IUserQualityProfiles {
|
||||||
sonarrQualityProfile: number;
|
sonarrQualityProfile: number;
|
||||||
radarrRootPath: number;
|
radarrRootPath: number;
|
||||||
radarrQualityProfile: number;
|
radarrQualityProfile: number;
|
||||||
|
radarr4KRootPath: number;
|
||||||
|
radarr4KQualityProfile: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ICreateWizardUser {
|
export interface ICreateWizardUser {
|
||||||
|
|
|
@ -141,6 +141,24 @@
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field *ngIf="radarr4KQualities">
|
||||||
|
<mat-label>Radarr 4K Quality Profiles</mat-label>
|
||||||
|
<mat-select [(ngModel)]="user.userQualityProfiles.radarr4KQualityProfile">
|
||||||
|
<mat-option *ngFor="let folder of radarr4KQualities" [value]="folder.id">
|
||||||
|
{{folder.name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field *ngIf="radarr4KRootFolders">
|
||||||
|
<mat-label>Radarr 4K Root Folder</mat-label>
|
||||||
|
<mat-select [(ngModel)]="user.userQualityProfiles.radarr4KRootPath">
|
||||||
|
<mat-option *ngFor="let folder of radarr4KRootFolders" [value]="folder.id">
|
||||||
|
{{folder.path}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2 col-sm-12">
|
<div class="col-md-2 col-sm-12">
|
||||||
|
|
|
@ -24,6 +24,8 @@ export class UserManagementUserComponent implements OnInit {
|
||||||
public sonarrRootFolders: ISonarrRootFolder[];
|
public sonarrRootFolders: ISonarrRootFolder[];
|
||||||
public radarrQualities: IRadarrProfile[];
|
public radarrQualities: IRadarrProfile[];
|
||||||
public radarrRootFolders: IRadarrRootFolder[];
|
public radarrRootFolders: IRadarrRootFolder[];
|
||||||
|
public radarr4KQualities: IRadarrProfile[];
|
||||||
|
public radarr4KRootFolders: IRadarrRootFolder[];
|
||||||
|
|
||||||
public NotificationAgent = INotificationAgent;
|
public NotificationAgent = INotificationAgent;
|
||||||
public edit: boolean;
|
public edit: boolean;
|
||||||
|
@ -93,6 +95,17 @@ export class UserManagementUserComponent implements OnInit {
|
||||||
this.radarrRootFolders.unshift({id: 0, path: "None"});
|
this.radarrRootFolders.unshift({id: 0, path: "None"});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (is4KEnabled) {
|
||||||
|
this.radarrService.getRootFolders4kFromSettings().subscribe(x => {
|
||||||
|
this.radarr4KRootFolders = x;
|
||||||
|
this.radarr4KRootFolders.unshift({id: 0, path: "None"});
|
||||||
|
});
|
||||||
|
this.radarrService.getQualityProfiles4kFromSettings().subscribe(x => {
|
||||||
|
this.radarr4KQualities = x;
|
||||||
|
this.radarr4KQualities.unshift({id: 0, name: "None"});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.identityService.getUserAccessToken(this.userId).subscribe(x => this.accessToken = x);
|
this.identityService.getUserAccessToken(this.userId).subscribe(x => this.accessToken = x);
|
||||||
|
|
||||||
if(!this.edit) {
|
if(!this.edit) {
|
||||||
|
@ -118,6 +131,8 @@ export class UserManagementUserComponent implements OnInit {
|
||||||
userQualityProfiles: {
|
userQualityProfiles: {
|
||||||
radarrQualityProfile: 0,
|
radarrQualityProfile: 0,
|
||||||
radarrRootPath: 0,
|
radarrRootPath: 0,
|
||||||
|
radarr4KQualityProfile: 0,
|
||||||
|
radarr4KRootPath: 0,
|
||||||
sonarrQualityProfile: 0,
|
sonarrQualityProfile: 0,
|
||||||
sonarrQualityProfileAnime: 0,
|
sonarrQualityProfileAnime: 0,
|
||||||
sonarrRootPath: 0,
|
sonarrRootPath: 0,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -691,6 +691,8 @@ namespace Ombi.Controllers.V1
|
||||||
currentQualityProfiles.SonarrQualityProfileAnime = ui.UserQualityProfiles.SonarrQualityProfileAnime;
|
currentQualityProfiles.SonarrQualityProfileAnime = ui.UserQualityProfiles.SonarrQualityProfileAnime;
|
||||||
currentQualityProfiles.SonarrRootPath = ui.UserQualityProfiles.SonarrRootPath;
|
currentQualityProfiles.SonarrRootPath = ui.UserQualityProfiles.SonarrRootPath;
|
||||||
currentQualityProfiles.SonarrRootPathAnime = ui.UserQualityProfiles.SonarrRootPathAnime;
|
currentQualityProfiles.SonarrRootPathAnime = ui.UserQualityProfiles.SonarrRootPathAnime;
|
||||||
|
currentQualityProfiles.Radarr4KRootPath = ui.UserQualityProfiles.Radarr4KRootPath;
|
||||||
|
currentQualityProfiles.Radarr4KQualityProfile = ui.UserQualityProfiles.Radarr4KQualityProfile;
|
||||||
if (add)
|
if (add)
|
||||||
{
|
{
|
||||||
await _userQualityProfiles.Add(currentQualityProfiles);
|
await _userQualityProfiles.Add(currentQualityProfiles);
|
||||||
|
|
|
@ -51,6 +51,14 @@
|
||||||
<None Remove="wwwroot\dist\**" />
|
<None Remove="wwwroot\dist\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Remove="database.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="database.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\.editorconfig" Link=".editorconfig" />
|
<None Include="..\.editorconfig" Link=".editorconfig" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue