Skip to content

Allow per-user Radarr and Sonarr quality profile selection#5449

Open
herbalizer404 wants to merge 5 commits into
Ombi-app:developfrom
herbalizer404:feature/per-user-arr-quality-profiles
Open

Allow per-user Radarr and Sonarr quality profile selection#5449
herbalizer404 wants to merge 5 commits into
Ombi-app:developfrom
herbalizer404:feature/per-user-arr-quality-profiles

Conversation

@herbalizer404

@herbalizer404 herbalizer404 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

This adds dedicated SelectRadarrQualityProfile and SelectSonarrQualityProfile roles so trusted users can choose a quality profile per movie or TV request without receiving Power User access. Administrators can explicitly restrict each user to an allowlist of profiles.

What changed

  • Adds the SelectRadarrQualityProfile and SelectSonarrQualityProfile roles.
  • Adds a normalized UserSelectableQualityProfile relation with a unique per-user/application/profile/instance constraint and cascade deletion.
  • Adds SQLite, MySQL, and PostgreSQL migrations and updated EF snapshots.
  • Adds allowlist configuration to user administration for:
    • standard Radarr profiles;
    • Radarr 4K profiles;
    • Sonarr profiles.
  • Adds authenticated selectable-profile endpoints that expose only profile id and name.
  • Keeps existing Power User profile endpoints and their contracts unchanged.
  • Adds profile selectors to movie and TV request flows, including Discover and episode requests.
  • Supports both new and existing requests and persists the selected override.
  • Adds English and French labels for the new administration fields.

Authorization and fail-closed behavior

For normal users, selecting a profile requires both the corresponding request permission and the dedicated selection role:

  • movies: RequestMovie + SelectRadarrQualityProfile;
  • TV: RequestTv + SelectSonarrQualityProfile.

A normal user with the dedicated role but no allowlisted profiles sees no selectable profiles. New profiles added later in Radarr or Sonarr are not automatically exposed.

Admin and Power User behavior remains unrestricted.

Server-side enforcement

The backend independently verifies:

  • the current user's role;
  • membership of the submitted profile in that user's allowlist;
  • whether the profile still exists in the requested Radarr standard/4K instance or Sonarr.

The dedicated roles do not grant access to API keys, connection settings, root-folder selection, language-profile selection, request-on-behalf controls, user administration, or other Power User capabilities.

Test plan

  • Full Ombi.Core.Tests suite: exit 0
  • Full Ombi.Tests suite: exit 0
  • Focused TV V1 persistence regression: exit 0
  • Focused Angular suites: 75 passed
  • Angular production build
  • git diff --check
  • Two-cycle native code review: final verdict APPROVE
  • Disposable SQLite upgrade applied both new migrations
  • Disposable Ombi instance connected to real Radarr and Sonarr APIs
  • Non-admin access-token smoke test returned exactly the two allowlisted profiles for both Radarr and Sonarr, and no Radarr 4K profiles
  • Manual mobile UI verification and screenshot on the disposable instance

Existing dependency advisory and SCSS budget warnings are unchanged by this PR.

Database coverage

  • SQLite migration executed on the disposable instance and through automated migration tests.
  • MySQL and PostgreSQL migrations compile and their snapshots were reviewed; no external MySQL/PostgreSQL services were used.

Branch

  • Base: develop at add609c82e699cddbb627f078e197925c93f3e32
  • Branch: feature/per-user-arr-quality-profiles
  • Commit: 0a4f82fe2

Submitted from the contributor fork; no changes were pushed directly to the upstream repository.

Summary by CodeRabbit

  • New Features
    • Added per-user selectable Radarr (standard/4K) and Sonarr quality profiles with new role-based permissions.
    • Added selectable profile endpoints and introduced a “quality-only” request dialog mode.
    • Updated movie and TV request flows plus UI to support standard vs 4K profile selection.
  • Bug Fixes
    • Improved permission gating and validation for quality/root overrides, including separate handling for 4K quality overrides.
  • Tests
    • Expanded coverage for request validation, dialog behaviour, controller endpoints, and new EF Core migrations/roles.

@reposhark

reposhark Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦈 RepoShark Health Check

Metric Value
Health Score 🔴 55/100 (no change)
PR Size XL

View full analysis → · Powered by RepoShark

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds per-user Radarr and Sonarr quality-profile allowlists, persistence, role-based backend validation, selectable-profile endpoints, quality-only request dialogs, administration controls, 4K override handling, and automated tests.

Changes

Quality profile permissions

Layer / File(s) Summary
Permission storage and administration
src/Ombi.Store/..., src/Ombi/Controllers/V1/IdentityController.cs, src/Ombi/ClientApp/src/app/usermanagement/...
Adds selectable-profile entities, provider migrations, roles, user fields, administration controls, and persistence logic.
Backend filtering and request validation
src/Ombi.Core/Engine/..., src/Ombi/Controllers/V1/External/...
Validates Radarr and Sonarr overrides against user permissions and live service profiles, including standard and 4K Radarr paths.
Frontend quality-only request flow
src/Ombi/ClientApp/src/app/shared/admin-request-dialog/..., src/Ombi/ClientApp/src/app/media-details/..., src/Ombi/ClientApp/src/app/discover/...
Enables role-authorised quality-only dialogs, selectable profile loading, 4K profile handling, and loading/error states.
Validation and schema coverage
src/Ombi.Core.Tests/..., src/Ombi.Tests/..., src/Ombi/ClientApp/src/**/*.spec.ts, src/Ombi.Store/Migrations/...
Tests request validation, endpoint filtering, migrations, persistence, UI routing, 4K handling, and default behaviour; updates generated provider snapshots.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • Ombi-app/Ombi#5376: Modifies the TV request grid flow that this change extends with quality-profile role gating.

Suggested labels: translations

Poem

A rabbit hops through profiles bright,
Choosing Radarr paths just right.
Sonarr follows, permissions clear,
Quality picks are safely near.
Tests guard each carrot-lined door—
Hop, hop, ship, and ask no more!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning It lacks the required Conventional Commits prefix and : format. Use a title like "feat: allow per-user radarr and sonarr quality profile selection".
Docstring Coverage ⚠️ Warning Docstring coverage is 8.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the summary, changes, authorization, testing, and database coverage, so it is mostly complete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tidusjar

tidusjar commented Jul 23, 2026

Copy link
Copy Markdown
Member

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (3)
src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs (1)

927-939: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Snapshot looks hand-edited rather than tool-generated.

UseMySqlIdentityColumn is a real Pomelo PropertyBuilder extension, but calling it as MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id")) right after a separate b.Property<int>("Id")...HasColumnType("int") call is not how dotnet ef migrations add normally emits this (elsewhere in this same file, auto-increment Id properties never get this explicit annotation call). Functionally harmless, but worth regenerating the snapshot via tooling to avoid future drift/spurious diffs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs` around
lines 927 - 939, Regenerate the model snapshot using the project’s EF migration
tooling instead of manually editing it. In the UserSelectableQualityProfile
entity configuration, remove the explicit
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn call if regeneration omits
it, while preserving the generated property, key, index, and table
configuration.
src/Ombi.Store/Context/OmbiContext.cs (1)

56-63: 🗄️ Data Integrity & Integration | 🔵 Trivial

Add the UserId length constraint to the Fluent API.

UserSelectableQualityProfile.UserId is unbounded in the entity class and OmbiContext.cs, while the migrations/snapshots enforce maxLength: 128. Configure it in OnModelCreating so future migrations don’t report a model snapshot drift.

🔧 Suggested fix
             builder.Entity<UserSelectableQualityProfile>()
                 .HasIndex(x => new { x.UserId, x.Application, x.QualityProfileId, x.Is4K })
                 .IsUnique();
             builder.Entity<UserSelectableQualityProfile>()
+                .Property(x => x.UserId)
+                .HasMaxLength(128);
+            builder.Entity<UserSelectableQualityProfile>()
                 .HasOne(x => x.User)
                 .WithMany()
                 .HasForeignKey(x => x.UserId)
                 .OnDelete(DeleteBehavior.Cascade);

[low_effort_and_high_yield]

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Ombi.Store/Context/OmbiContext.cs` around lines 56 - 63, Update the
UserSelectableQualityProfile mapping in OnModelCreating to configure UserId with
the existing 128-character maximum length, alongside its index and foreign-key
configuration. Keep the current uniqueness and cascade-delete behavior
unchanged.
src/Ombi/Controllers/V1/External/RadarrController.cs (1)

116-153: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate Admin/PowerUser bypass + allowlist-filter logic across RadarrController and SonarrController. Both controllers independently re-implement "resolve current user → bypass filtering for Admin/PowerUser (two sequential IsInRoleAsync calls) → else query UserSelectableQualityProfile for allowed QualityProfileIds". Extracting this into a shared service would remove the duplication and reduce the risk of the two implementations silently diverging (e.g. one filtering by Is4K, the other not).

  • src/Ombi/Controllers/V1/External/RadarrController.cs#L116-L153: move FilterSelectableProfiles into a shared IRepository<UserSelectableQualityProfile>-backed helper/service usable by both controllers, and combine the two IsInRoleAsync calls into a single GetRolesAsync check.
  • src/Ombi/Controllers/V1/External/SonarrController.cs#L86-L103: replace the inline bypass/allowlist logic in GetSelectableProfiles with a call to the same shared helper/service.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Ombi/Controllers/V1/External/RadarrController.cs` around lines 116 - 153,
Extract RadarrController.FilterSelectableProfiles into a shared service/helper
backed by IRepository<UserSelectableQualityProfile>, preserving the is4K-aware
allowlist filtering and Admin/PowerUser bypass while replacing the two
sequential IsInRoleAsync calls with a single GetRolesAsync check. In
src/Ombi/Controllers/V1/External/RadarrController.cs#L116-153, inject and use
the shared helper from both selectable-profile endpoints; in
src/Ombi/Controllers/V1/External/SonarrController.cs#L86-103, replace the inline
bypass/allowlist logic in GetSelectableProfiles with that same helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Ombi.Core/Engine/MovieRequestEngine.cs`:
- Around line 183-186: Update the existing-request update logic around
QualityPathOverride so SD and 4K requests do not overwrite a shared
QualityOverride value. Store or update the override in the variant-specific
field selected by the request’s 4K state, and ensure MovieSender.Send(model,
is4K) reads the matching variant value.

In
`@src/Ombi.Store/Migrations/OmbiMySql/20260723000000_UserSelectableQualityProfiles.cs`:
- Line 15: Replace the raw Sonarr role SQL in
src/Ombi.Store/Migrations/OmbiMySql/20260723000000_UserSelectableQualityProfiles.cs:15
with InsertRoleMySql(OmbiRoles.SelectSonarrQualityProfile). Replace the
corresponding raw SQL in
src/Ombi.Store/Migrations/OmbiPostgres/20260723000000_UserSelectableQualityProfiles.cs:16
with InsertRolePostgres(OmbiRoles.SelectSonarrQualityProfile), matching the
existing Radarr role migration pattern.

In
`@src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.ts`:
- Around line 88-89: Move the assignment to this.data.series.requested out of
the pre-dialog flow and apply it only after AdminRequestDialogComponent resolves
with a successful submission. Preserve the cancellation path for non-admin
quality-only requests so closing the dialog leaves requested unchanged, and keep
the existing admin behavior intact.

In
`@src/Ombi/ClientApp/src/app/usermanagement/usermanagement-user.component.html`:
- Around line 91-110: Update the *ngIf conditions for selectableRadarrQualities,
selectableRadarr4KQualities, and selectableSonarrQualities to require a
non-empty array, such as checking each collection’s length, so fields are hidden
when profile lists resolve to [].

In `@src/Ombi/Controllers/V1/IdentityController.cs`:
- Around line 1089-1109: Wrap the delete-and-reinsert workflow in
ReplaceSelectableProfiles within a database transaction. Begin the transaction
before DeleteRange(existing), perform AddRange(profiles) within the same
transaction, commit only after both operations succeed, and roll back on failure
so the existing selectable profiles are preserved if insertion fails.

---

Nitpick comments:
In `@src/Ombi.Store/Context/OmbiContext.cs`:
- Around line 56-63: Update the UserSelectableQualityProfile mapping in
OnModelCreating to configure UserId with the existing 128-character maximum
length, alongside its index and foreign-key configuration. Keep the current
uniqueness and cascade-delete behavior unchanged.

In `@src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs`:
- Around line 927-939: Regenerate the model snapshot using the project’s EF
migration tooling instead of manually editing it. In the
UserSelectableQualityProfile entity configuration, remove the explicit
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn call if regeneration omits
it, while preserving the generated property, key, index, and table
configuration.

In `@src/Ombi/Controllers/V1/External/RadarrController.cs`:
- Around line 116-153: Extract RadarrController.FilterSelectableProfiles into a
shared service/helper backed by IRepository<UserSelectableQualityProfile>,
preserving the is4K-aware allowlist filtering and Admin/PowerUser bypass while
replacing the two sequential IsInRoleAsync calls with a single GetRolesAsync
check. In src/Ombi/Controllers/V1/External/RadarrController.cs#L116-153, inject
and use the shared helper from both selectable-profile endpoints; in
src/Ombi/Controllers/V1/External/SonarrController.cs#L86-103, replace the inline
bypass/allowlist logic in GetSelectableProfiles with that same helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c1c4bbb-ca70-4323-9932-f3b7ec417958

📥 Commits

Reviewing files that changed from the base of the PR and between add609c and 0a4f82f.

📒 Files selected for processing (44)
  • src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs
  • src/Ombi.Core.Tests/Engine/TvRequestEngineTests.cs
  • src/Ombi.Core.Tests/Engine/V2/MovieRequestEngineTests.cs
  • src/Ombi.Core/Engine/MovieRequestEngine.cs
  • src/Ombi.Core/Engine/TvRequestEngine.cs
  • src/Ombi.Core/Helpers/TvShowRequestBuilder.cs
  • src/Ombi.Core/Models/UI/UserViewModel.cs
  • src/Ombi.Helpers/OmbiRoles.cs
  • src/Ombi.Store/Context/OmbiContext.cs
  • src/Ombi.Store/Entities/UserSelectableQualityProfile.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260722000000_SelectRadarrQualityProfileRole.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/20260722000000_SelectRadarrQualityProfileRole.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260722000000_SelectRadarrQualityProfileRole.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/OmbiSqliteContextModelSnapshot.cs
  • src/Ombi.Tests/Controllers/V1/External/RadarrControllerTests.cs
  • src/Ombi.Tests/Controllers/V1/External/SonarrControllerTests.cs
  • src/Ombi.Tests/Migrations/SelectRadarrQualityProfileRoleTests.cs
  • src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.spec.ts
  • src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts
  • src/Ombi/ClientApp/src/app/interfaces/IUser.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.spec.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts
  • src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.ts
  • src/Ombi/ClientApp/src/app/services/applications/radarr.service.spec.ts
  • src/Ombi/ClientApp/src/app/services/applications/radarr.service.ts
  • src/Ombi/ClientApp/src/app/services/applications/sonarr.service.spec.ts
  • src/Ombi/ClientApp/src/app/services/applications/sonarr.service.ts
  • src/Ombi/ClientApp/src/app/shared/admin-request-dialog/admin-request-dialog.component.html
  • src/Ombi/ClientApp/src/app/shared/admin-request-dialog/admin-request-dialog.component.spec.ts
  • src/Ombi/ClientApp/src/app/shared/admin-request-dialog/admin-request-dialog.component.ts
  • src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.spec.ts
  • src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.ts
  • src/Ombi/ClientApp/src/app/usermanagement/usermanagement-user.component.html
  • src/Ombi/ClientApp/src/app/usermanagement/usermanagement-user.component.ts
  • src/Ombi/Controllers/V1/External/RadarrController.cs
  • src/Ombi/Controllers/V1/External/SonarrController.cs
  • src/Ombi/Controllers/V1/IdentityController.cs
  • src/Ombi/wwwroot/translations/en.json
  • src/Ombi/wwwroot/translations/fr.json

Comment thread src/Ombi.Core/Engine/MovieRequestEngine.cs
Comment thread src/Ombi/ClientApp/src/app/usermanagement/usermanagement-user.component.html Outdated
Comment thread src/Ombi/Controllers/V1/IdentityController.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs (1)

213-216: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Require the base movie-request permission in successful selector-role tests.

The positive cases pass only SelectRadarrQualityProfile, so this helper returns false for the underlying movie-request role while the tests still expect a successful request. Require both roles in successful cases and add a selector-only rejection case; otherwise this suite permits the dedicated selection role to become a request-creation permission.

Proposed test adjustment
- SetupMovieRequestRoles(OmbiRoles.SelectRadarrQualityProfile);
+ SetupMovieRequestRoles(
+     OmbiRoles.RequestMovie,
+     OmbiRoles.SelectRadarrQualityProfile);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs` around lines 213 -
216, Update SetupMovieRequestRoles and the related successful selector-role
tests so successful requests require both the base movie-request permission and
SelectRadarrQualityProfile. Add a selector-only rejection test that verifies
request creation is denied without the base permission, preserving the existing
role-checking behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/Ombi.Store/Migrations/OmbiMySql/20260723000001_QualityOverride4K.Designer.cs`:
- Line 21: Regenerate the migration designer files using the repository’s .NET
SDK and EF Core/provider 8.0.x toolchain so their ProductVersion and provider
annotations match the configured versions. Apply this to
src/Ombi.Store/Migrations/OmbiMySql/20260723000001_QualityOverride4K.Designer.cs,
src/Ombi.Store/Migrations/OmbiPostgres/20260723000001_QualityOverride4K.Designer.cs,
and
src/Ombi.Store/Migrations/OmbiSqlite/20260723000001_QualityOverride4K.Designer.cs;
no manual version edits or unrelated migration changes are needed.

In
`@src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts`:
- Around line 338-352: After the successful update calls in the options flow,
synchronise this.movieRequest.qualityOverride and qualityOverride4K with the
selected profile values, including both values for RequestCombination.Both and
the applicable override for single-quality requests, before
setAdvancedOptions(result).

In
`@src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.html`:
- Around line 10-13: Update the mat-option elements in the movie
advanced-options template, including the 4K profile selector and the selectors
binding profileId and rootFolderId, to use numeric property binding for
profile.id or rootFolder.id instead of interpolated value attributes. Preserve
the existing option iteration and displayed names while ensuring all bound IDs
remain numbers.

---

Outside diff comments:
In `@src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs`:
- Around line 213-216: Update SetupMovieRequestRoles and the related successful
selector-role tests so successful requests require both the base movie-request
permission and SelectRadarrQualityProfile. Add a selector-only rejection test
that verifies request creation is denied without the base permission, preserving
the existing role-checking behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f65be1f8-6345-4bb4-b557-6d93f3cee2b6

📥 Commits

Reviewing files that changed from the base of the PR and between 0a4f82f and bf41aa7.

📒 Files selected for processing (35)
  • src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs
  • src/Ombi.Core.Tests/Senders/MovieSenderTests.cs
  • src/Ombi.Core/Engine/MovieRequestEngine.cs
  • src/Ombi.Core/Models/Requests/MovieAdvancedOptions.cs
  • src/Ombi.Core/Senders/MovieSender.cs
  • src/Ombi.Store/Context/OmbiContext.cs
  • src/Ombi.Store/Entities/Requests/MovieRequests.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260723000001_QualityOverride4K.cs
  • src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000001_QualityOverride4K.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260723000001_QualityOverride4K.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/OmbiSqliteContextModelSnapshot.cs
  • src/Ombi.Store/Repository/BaseRepository.cs
  • src/Ombi.Store/Repository/IExternalRepository.cs
  • src/Ombi.Store/Repository/IRepository.cs
  • src/Ombi.Tests/Migrations/SelectRadarrQualityProfileRoleTests.cs
  • src/Ombi/ClientApp/src/app/interfaces/IRadarr.ts
  • src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.spec.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.html
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.spec.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts
  • src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.spec.ts
  • src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.ts
  • src/Ombi/ClientApp/src/app/usermanagement/usermanagement-user.component.html
  • src/Ombi/ClientApp/src/app/usermanagement/usermanagement-user.component.spec.ts
  • src/Ombi/Controllers/V1/IdentityController.cs
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Context/OmbiContext.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260723000000_UserSelectableQualityProfiles.cs
  • src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs
  • src/Ombi/ClientApp/src/app/usermanagement/usermanagement-user.component.html
  • src/Ombi/Controllers/V1/IdentityController.cs
  • src/Ombi.Core/Engine/MovieRequestEngine.cs

Comment thread src/Ombi.Store/Migrations/OmbiMySql/20260723000001_QualityOverride4K.Designer.cs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs`:
- Line 172: Review the DateTime column mappings in
OmbiPostgresContextModelSnapshot before merging: preserve timestamp with time
zone for UTC instant values, or add an explicit tested migration conversion if
timestamp without time zone is required. Update the affected model snapshot and
corresponding migration consistently, ensuring existing persisted UTC data
retains its intended semantics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a9c3129-570b-4859-aedf-d8f725d0eef3

📥 Commits

Reviewing files that changed from the base of the PR and between bf41aa7 and 527eb15.

📒 Files selected for processing (12)
  • src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/OmbiSqliteContextModelSnapshot.cs
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.spec.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.html
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.spec.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.html
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.spec.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.spec.ts
  • src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiMySql/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiSqlite/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts
  • src/Ombi.Store/Migrations/OmbiSqlite/OmbiSqliteContextModelSnapshot.cs
  • src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs

Comment thread src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs Outdated
@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs (1)

1032-1034: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Make UserSelectableQualityProfile.UserId required.

The snapshot currently models this foreign key as nullable, allowing orphaned allowlist rows with NULL user IDs; PostgreSQL can also permit multiple such rows despite the composite unique index. Mark the property and relationship as required in the entity configuration, then regenerate the migration and snapshot.

Also applies to: 1331-1334

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs`
around lines 1032 - 1034, Update the UserSelectableQualityProfile entity
configuration in OmbiPostgresContextModelSnapshot so UserId is non-nullable and
its foreign-key relationship is required, preventing orphaned allowlist rows.
Regenerate the corresponding EF migration and model snapshot so the database
column and relationship constraints match the required UserId contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs`:
- Around line 1032-1034: Update the UserSelectableQualityProfile entity
configuration in OmbiPostgresContextModelSnapshot so UserId is non-nullable and
its foreign-key relationship is required, preventing orphaned allowlist rows.
Regenerate the corresponding EF migration and model snapshot so the database
column and relationship constraints match the required UserId contract.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7358c001-7405-400d-9401-3b37575e0019

📥 Commits

Reviewing files that changed from the base of the PR and between 527eb15 and 59fbabc.

📒 Files selected for processing (2)
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000001_QualityOverride4K.Designer.cs
  • src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Ombi.Store/Migrations/OmbiPostgres/20260723000001_QualityOverride4K.Designer.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants