BUG: Missing Sonarr link button on TV request cards (Ombi integration) #58

Closed
opened 2026-05-27 23:22:30 +01:00 by Gandalf · 1 comment
Owner

Summary

The Sonarr deep-link button (the icon that takes administrators directly to the matching series in Sonarr) is missing from TV request cards in the Ombi requests section.

The equivalent Radarr link button works correctly on movie request cards.

This affects administrators who have Ombi integration enabled and use Sonarr for TV shows.


Steps to Reproduce

  1. Ensure Ombi integration is configured (OMBI_URL + OMBI_API_KEY).
  2. Have at least one TV request in Ombi that matches a series in Sonarr.
  3. Open the sofarr dashboard.
  4. Navigate to the Requests or Ombi Requests section.
  5. Observe TV request cards:
    • Expected: Sonarr icon/link button visible (similar to Radarr on movie cards).
    • Actual: No Sonarr link button appears.

Expected Behavior

TV request cards should display a clickable Sonarr icon that deep-links directly to the series in Sonarr (e.g. /series/{sonarrSeriesId}), exactly like movie cards show the Radarr icon.


Actual Behavior

  • Movie request cards correctly show the Radarr link button.
  • TV request cards show no Sonarr link button.
  • The Ombi "View in Ombi" link still works, but the direct Sonarr deep-link is absent.

Root Cause Analysis

Confirmed Issue (Frontend)

File: client/src/ui/requests.js (line ~197)

The ID extraction logic used to build the Ombi deep-link (and potentially influence Sonarr/Radarr link rendering) is incomplete:

const id = request.theTvDbId || request.theMovieDbId || request.theTvdbId || request.theTmdbId || request.TvDbId || request.TheTvDbId || request.imdbId || request.ImdbId;

Problem:
tvDbId and tvdbId (camelCase variants) are missing from the list.
Ombi sometimes returns the TVDB ID under these property names. When the ID cannot be reliably extracted, the Sonarr link generation logic fails to produce a valid URL.

Suspected Backend Issue

The original analysis referenced a function decorateRequestsWithArrLinks in server/utils/ombiHelpers.js that was responsible for enriching Ombi requests with arrLink and arrType fields.

Current Status (as of 2026-05-27):

  • This exact function no longer appears in server/utils/ombiHelpers.js or server/routes/ombi.js.
  • The Ombi route handles request fetching and media type tagging (mediaType: 'tv' / 'movie'), but the Sonarr/Radarr link decoration logic appears to have been refactored or moved.
  • Recent Ombi-related commits (v1.7.27) focused on TV request status, user, and date display.

Likely Root Cause (Backend):
The backend fails to populate request.arrLink (or equivalent) for TV requests because the TVDB ID extraction logic is incomplete or missing the same property variants (tvDbId, tvdbId).

Without a valid arrLink, the frontend has no URL to render the Sonarr button.


Impact

  • Administrators lose one-click access to Sonarr from the dashboard for TV requests.
  • Workflow friction increases for users managing both Sonarr and Ombi.
  • Inconsistent behavior between movie (Radarr) and TV (Sonarr) request cards.

Proposed Fix

1. Frontend Fix (Confirmed Safe)

File: client/src/ui/requests.js

Update the ID extraction to include all common TVDB property variants:

const id = request.theTvDbId || request.theTvdbId || request.tvDbId || request.tvdbId || request.TvDbId || request.TheTvDbId || request.theMovieDbId || request.theTmdbId || request.imdbId || request.ImdbId;

2. Backend Fix (Requires Location Confirmation)

Once the current location of Sonarr/Radarr link decoration is identified, apply similar defensive ID extraction:

Example pattern to apply wherever TVDB ID resolution occurs:

const tvdbId = request.theTvDbId || request.theTvdbId || request.tvDbId || request.tvdbId || request.TvDbId || request.TheTvDbId;
const tmdbId = request.theMovieDbId || request.theTmdbId || request.TmdbId;

const isTv = request.mediaType === 'tv' || request.type === 'Tv' || !!tvdbId;

Then use tvdbId (preferred) or tmdbId (fallback) to generate the Sonarr deep link.


Recommended Next Steps (for Maintainers)

  1. Search the codebase for current usage of arrLink, arrType, or Sonarr deep-link generation.
  2. Apply the ID extraction improvements in both frontend and backend.
  3. Add or update unit tests covering TV request objects with different ID property names (tvDbId, theTvdbId, etc.).
  4. Manually verify that TV request cards now display the Sonarr icon after the fix.

Environment

  • sofarr version: v1.7.27
  • Ombi version: Any recent version
  • Sonarr version: v4.x (uses TVDB IDs primarily)
  • Browser: Any modern browser
  • Deployment: Docker or manual

Additional Notes

  • This bug was introduced or exposed during recent Ombi integration improvements (v1.7.27).
  • The fix is low-risk, targeted, and follows the existing pattern of defensive property access already used for other fields.
  • No breaking changes expected.
## Summary The **Sonarr deep-link button** (the icon that takes administrators directly to the matching series in Sonarr) is **missing** from TV request cards in the Ombi requests section. The equivalent **Radarr link button** works correctly on movie request cards. This affects administrators who have Ombi integration enabled and use Sonarr for TV shows. --- ## Steps to Reproduce 1. Ensure Ombi integration is configured (`OMBI_URL` + `OMBI_API_KEY`). 2. Have at least one TV request in Ombi that matches a series in Sonarr. 3. Open the sofarr dashboard. 4. Navigate to the **Requests** or **Ombi Requests** section. 5. Observe TV request cards: - Expected: Sonarr icon/link button visible (similar to Radarr on movie cards). - Actual: No Sonarr link button appears. --- ## Expected Behavior TV request cards should display a clickable Sonarr icon that deep-links directly to the series in Sonarr (e.g. `/series/{sonarrSeriesId}`), exactly like movie cards show the Radarr icon. --- ## Actual Behavior - Movie request cards correctly show the Radarr link button. - TV request cards show **no Sonarr link button**. - The Ombi "View in Ombi" link still works, but the direct Sonarr deep-link is absent. --- ## Root Cause Analysis ### Confirmed Issue (Frontend) **File:** `client/src/ui/requests.js` (line ~197) The ID extraction logic used to build the Ombi deep-link (and potentially influence Sonarr/Radarr link rendering) is incomplete: ```javascript const id = request.theTvDbId || request.theMovieDbId || request.theTvdbId || request.theTmdbId || request.TvDbId || request.TheTvDbId || request.imdbId || request.ImdbId; ``` **Problem:** `tvDbId` and `tvdbId` (camelCase variants) are **missing** from the list. Ombi sometimes returns the TVDB ID under these property names. When the ID cannot be reliably extracted, the Sonarr link generation logic fails to produce a valid URL. ### Suspected Backend Issue The original analysis referenced a function `decorateRequestsWithArrLinks` in `server/utils/ombiHelpers.js` that was responsible for enriching Ombi requests with `arrLink` and `arrType` fields. **Current Status (as of 2026-05-27):** - This exact function **no longer appears** in `server/utils/ombiHelpers.js` or `server/routes/ombi.js`. - The Ombi route handles request fetching and media type tagging (`mediaType: 'tv'` / `'movie'`), but the Sonarr/Radarr link decoration logic appears to have been refactored or moved. - Recent Ombi-related commits (v1.7.27) focused on TV request status, user, and date display. **Likely Root Cause (Backend):** The backend fails to populate `request.arrLink` (or equivalent) for TV requests because the TVDB ID extraction logic is incomplete or missing the same property variants (`tvDbId`, `tvdbId`). Without a valid `arrLink`, the frontend has no URL to render the Sonarr button. --- ## Impact - Administrators lose one-click access to Sonarr from the dashboard for TV requests. - Workflow friction increases for users managing both Sonarr and Ombi. - Inconsistent behavior between movie (Radarr) and TV (Sonarr) request cards. --- ## Proposed Fix ### 1. Frontend Fix (Confirmed Safe) **File:** `client/src/ui/requests.js` Update the ID extraction to include all common TVDB property variants: ```javascript const id = request.theTvDbId || request.theTvdbId || request.tvDbId || request.tvdbId || request.TvDbId || request.TheTvDbId || request.theMovieDbId || request.theTmdbId || request.imdbId || request.ImdbId; ``` ### 2. Backend Fix (Requires Location Confirmation) Once the current location of Sonarr/Radarr link decoration is identified, apply similar defensive ID extraction: **Example pattern to apply wherever TVDB ID resolution occurs:** ```javascript const tvdbId = request.theTvDbId || request.theTvdbId || request.tvDbId || request.tvdbId || request.TvDbId || request.TheTvDbId; const tmdbId = request.theMovieDbId || request.theTmdbId || request.TmdbId; const isTv = request.mediaType === 'tv' || request.type === 'Tv' || !!tvdbId; ``` Then use `tvdbId` (preferred) or `tmdbId` (fallback) to generate the Sonarr deep link. --- ## Recommended Next Steps (for Maintainers) 1. Search the codebase for current usage of `arrLink`, `arrType`, or Sonarr deep-link generation. 2. Apply the ID extraction improvements in both frontend and backend. 3. Add or update unit tests covering TV request objects with different ID property names (`tvDbId`, `theTvdbId`, etc.). 4. Manually verify that TV request cards now display the Sonarr icon after the fix. --- ## Environment - **sofarr version:** v1.7.27 - **Ombi version:** Any recent version - **Sonarr version:** v4.x (uses TVDB IDs primarily) - **Browser:** Any modern browser - **Deployment:** Docker or manual --- ## Additional Notes - This bug was introduced or exposed during recent Ombi integration improvements (v1.7.27). - The fix is low-risk, targeted, and follows the existing pattern of defensive property access already used for other fields. - No breaking changes expected.
Gandalf added the Kind/Bug
Priority
Medium
3
labels 2026-05-27 23:22:56 +01:00
Author
Owner

Resolved in commit 5933e09652.

Resolved in commit 5933e09652988ec5d40f090a69a867ac0bd3022b.
Gandalf added the Area/Frontend label 2026-05-28 11:57:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/sofarr#58