[PR #116] [MERGED] TuneIn enhancements/fixes #171

Closed
opened 2026-02-27 19:28:43 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/lox-audioserver/lox-audioserver/pull/116
Author: @martinsefcik
Created: 1/12/2026
Status: Merged
Merged: 1/13/2026
Merged by: @rudyberends

Base: 4.x-branchHead: tunein-enhancements


📝 Commits (3)

  • a472c14 fix(tunein): ignore items with key='unavailable'z
  • 675fecd fix(tunein): extract radio name when item's text contains frequency or genre
  • f869862 fix(tunein): use square cover image (replace trailing q with d)

📊 Changes

1 file changed (+18 additions, -3 deletions)

View changed files

📝 src/modules/content/providers/tunein/tuneinProvider.ts (+18 -3)

📄 Description

  1. Ignore unavailable TuneIn items

    I added logic to ignore a specific type of TuneIn item retrieved from the API. If an item contains the key field with the value unavailable, it is not imported because such items either have no stream or their stream only contains a message stating that the radio stream is unavailable.

    Example of such an item:

    {
      "element": "outline",
      "type": "audio",
      "text": "Fun Radio Rock - Not Supported",
      "URL": "http://cdn-cms.tunein.com/service/Audio/nostream.enUS.mp3",
      "guide_id": "s75207",
      "subtext": "Does not stream",
      "genre_id": "g115",
      "key": "unavailable",
      "item": "station",
      "image": "http://cdn-radiotime-logos.tunein.com/s75207q.png",
      "preset_number": "15",
      "preset_id": "s75207",
      "is_preset": "true"
    },
    
  2. Fix cover image cropping

    Not all cover images retrieved from the API are square, which causes them to be cropped in the Loxone app and look distorted.

    It appears that if the last character (q) in the file name is replaced with d, a resized 300×300 pixel cover image is returned. While this is not a perfect solution, it provides a reasonable workaround until any server-side image processing is implemented in the future (if needed).

    Before fix:
    image

    After fix:
    image

  3. Trim frequency and genre from radio station name

    The TuneIn API returns the radio name along with frequency and genre if available. However, based on screenshots and presentation videos from the Loxone app, it looks like only the radio name itself is displayed (without frequency or genre).

    Additionally, the genre is translated according to the Accept-Language header in the API call. Currently, nl-NL is used, so the genre appears in Dutch and if the genre is kept in the radio name, it may be better to make the language configurable.

    In this PR, I chose to trim the genre and frequency from the radio station name to match the Loxone app behavior.

    Loxone app presentation video (radio name only):
    image
    Even though the TuneIn API item contains frequency and genre:
    image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/lox-audioserver/lox-audioserver/pull/116 **Author:** [@martinsefcik](https://github.com/martinsefcik) **Created:** 1/12/2026 **Status:** ✅ Merged **Merged:** 1/13/2026 **Merged by:** [@rudyberends](https://github.com/rudyberends) **Base:** `4.x-branch` ← **Head:** `tunein-enhancements` --- ### 📝 Commits (3) - [`a472c14`](https://github.com/lox-audioserver/lox-audioserver/commit/a472c14835ae56fdeb3c4bcc0af52653fa92b48f) fix(tunein): ignore items with key='unavailable'z - [`675fecd`](https://github.com/lox-audioserver/lox-audioserver/commit/675fecd6cc4fa4ffe7d9697fd4443a5498c42920) fix(tunein): extract radio name when item's text contains frequency or genre - [`f869862`](https://github.com/lox-audioserver/lox-audioserver/commit/f869862d6da83ebd8bb2999596adf83253dc0a8d) fix(tunein): use square cover image (replace trailing `q` with `d`) ### 📊 Changes **1 file changed** (+18 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/modules/content/providers/tunein/tuneinProvider.ts` (+18 -3) </details> ### 📄 Description 1. Ignore unavailable TuneIn items I added logic to ignore a specific type of TuneIn item retrieved from the API. If an item contains the `key` field with the value `unavailable`, it is not imported because such items either have no stream or their stream only contains a message stating that the radio stream is unavailable. Example of such an item: ```json { "element": "outline", "type": "audio", "text": "Fun Radio Rock - Not Supported", "URL": "http://cdn-cms.tunein.com/service/Audio/nostream.enUS.mp3", "guide_id": "s75207", "subtext": "Does not stream", "genre_id": "g115", "key": "unavailable", "item": "station", "image": "http://cdn-radiotime-logos.tunein.com/s75207q.png", "preset_number": "15", "preset_id": "s75207", "is_preset": "true" }, ``` 2. Fix cover image cropping Not all cover images retrieved from the API are square, which causes them to be cropped in the Loxone app and look distorted. It appears that if the last character (q) in the file name is replaced with d, a resized 300×300 pixel cover image is returned. While this is not a perfect solution, it provides a reasonable workaround until any server-side image processing is implemented in the future (if needed). **Before fix:** <img width="1345" height="732" alt="image" src="https://github.com/user-attachments/assets/3e8f65b3-713b-403f-b773-f9505c3e13aa" /> **After fix:** <img width="1323" height="769" alt="image" src="https://github.com/user-attachments/assets/d4ee6164-1a84-45e0-a1dd-3aab93c80abd" /> 3. Trim frequency and genre from radio station name The TuneIn API returns the radio name along with frequency and genre if available. However, based on screenshots and presentation videos from the Loxone app, it looks like only the radio name itself is displayed (without frequency or genre). Additionally, the genre is translated according to the Accept-Language header in the API call. Currently, `nl-NL` is used, so the genre appears in Dutch and if the genre is kept in the radio name, it may be better to make the language configurable. In this PR, I chose to trim the genre and frequency from the radio station name to match the Loxone app behavior. **Loxone app presentation video (radio name only):** <img width="730" height="720" alt="image" src="https://github.com/user-attachments/assets/23f5014d-907a-4add-b0d9-2104421072d1" /> **Even though the TuneIn API item contains frequency and genre:** <img width="949" height="305" alt="image" src="https://github.com/user-attachments/assets/53b0fecc-da29-4195-a51a-5070e184b14d" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 19:28:43 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lox-audioserver#171
No description provided.