Jump to content

Live TV Channels No Longer Included in Global Search


Recommended Posts

Posted
4 minutes ago, Ladiesman0217 said:

Submitting a problem report here, as I am facing the same issue.

Problem
Live TV channels are missing from search results for most users — unscoped search omits `TvChannel`, but works for one user with identical Live TV permissions

Summary
Searching for a Live TV channel by name returns no results for our users. The channel is present, indexed, and searchable — a search *scoped* to `TvChannel` finds it — but the unscoped search (`/Items?SearchTerm=…`) returns `TotalRecordCount: 0` for channel-only terms, so no Live TV section is rendered. VOD search works normally for the same users.

One user out of 28 returns channels correctly, despite having the same Live TV policy settings as the users where it fails.

Environment

  • Emby Server 4.10.1.0 (Linux, x64), Docker image `emby/embyserver:latest`
  • Host OS: Ubuntu 24.04, kernel 6.17.0-29-generic
  • Live TV source: M3U tuner, ~815 channels
  • Clients tested: 
    • Emby Web 4.10.1.0 (Edge/Chrome on Windows),
    • Emby for Android 3.5.55,
    • Emby for Samsung 2.3.6,
    • Fire TV (Emby/2.5.03a).
    • The issue reproduces via the REST API with no client involved.

Steps to reproduce

  1. Sign in as a user with Live TV enabled
  2. Search for `KMBC`. The channel exists and is named "ABC: KANSAS CITY KMBC" (channel number 488695).
  3. Observe: no results / no Live TV section.
  4. Repeat as another user (same Live TV flags) → the channel does appear.

Reproducable via API (replace `<APIKEY>` / `<UserId>`):

# Fails (0 results) for User 1:
GET /Items?api_key=<APIKEY>&UserId=User1&SearchTerm=KMBC&Recursive=true
→ TotalRecordCount: 0

# Succeeds (1 result) for the same user, when scoped to TvChannel:
GET /Items?api_key=<APIKEY>&UserId=User1&SearchTerm=KMBC&Recursive=true&IncludeItemTypes=TvChannel
→ TotalRecordCount: 1  → "ABC: KANSAS CITY KMBC"

# Succeeds (5 results) for a different user, unscoped:
GET /Items?api_key=<APIKEY>&UserId=User2&SearchTerm=KMBC&Recursive=true
→ TotalRecordCount: 6

Expected
The channel appears in search results (with the Live TV section) for any user with Live TV access, the same way it does for `User 2`.

Actual
Unscoped search returns zero channels for 27 of 28 users, including every user with Live TV enabled except one. VOD search returns results normally for those same users.

Evidence

1. The channel is in the search index.__ Direct query of `library.db` (read-only):

SELECT rowid, * FROM fts_search9 WHERE fts_search9 MATCH '"KMBC"*';
7877514|ABC: KANSAS CITY KMBC|||

Rowid `7877514` is the channel. Emby's own bound query for the search matches it, and the server log confirms the search ran:

2026-10-19 21:32:24.572 Info SqliteItemRepository: Original search term: KMBC. Bound search term: "KMBC"*
2026-10-19 21:36:36.461 Info SqliteItemRepository: Original search term: KMBC. Bound search term: "KMBC"*
2026-10-19 20:58:23.923 Info SqliteItemRepository: Original search term: kansas city. Bound search term: "kansas" "city"*

2. Per-user results (`GET /Items?SearchTerm=<term>&Recursive=true&Limit=5`, all 28 users tested; results are stable across repeated calls):
 

User EnableLiveTvAccess EnableAllChannels unscoped "NESN" unscoped "KMBC" unscoped VOD
User2 true false 5 (TvChannel) 6 —
User1 true false 0 0 NCIS 3, Atlas 6 ✅
User3 true false 0 0 ✅
User4 true false 0 0 ✅
User5 true false 0 0 ✅
User6 false true 0 0 ✅
23 others false false 0 0 ✅

3. Same term, same user — only the type scope differs:

User1, SearchTerm=NESN, no IncludeItemTypes            → 0
User1, SearchTerm=NESN, IncludeItemTypes=TvChannel     → 5  (US: NESN, US: NESN PLUS, US: NESN (S), …)

4. Guide data is present, so this isn't a missing-EPG case — the channel has a current program:

Channel "ABC: KANSAS CITY KMBC" (Number 488695) → CurrentProgram "Live: NFL Football",
StartDate 2026-10-20T00:15:00Z, EndDate 2026-10-20T03:15:00Z

5. Why no Live TV section appears in the UI. In `dashboard-ui/search/search.js` / `emby-apiclient/apiclient.js`, the search view builds one section per item type returned by a separate call:

promises.push(this.getItems(userId, query, signal)),
query.StartIndex || query.IncludeItemTypes || false === query.IncludeSearchTypes
    || promises.push(this.getItemTypes(userId, query, signal)),
… responses[0].ItemTypes = responses[1].Items

Because the unscoped search reports no channels, `TvChannel` is absent from `ItemTypes`, so the client never queries or renders a Live TV section.

6. Observation on the working user: `User2`'s "Live TV" view id is `268391`, while every other user's is `251` (`GET /Users/{id}/Views`). Not sure if it's relevant, but it's the only difference I found.
 

Screenshots:

User 1

image.thumb.png.c29e8b0bf01287546d48fbd89f8d30be.png

User 2

image.thumb.png.f4f35d5c92e5b3350d155f33cc553afc.png

 

Logs attached.

embyserver.txt 49.58 kB · 0 downloads embyserver-63928045966.txt 25.43 MB · 0 downloads

hi, did you check other parental control restrictions for that user?

Ladiesman0217
Posted

Hi Luke,

Both the user that CAN and the one the CAN NOT search live channels have the same setting for parental controls

image.png.02deed0e3e9967d4297400bd5a431cd8.png

  • 2 weeks later...
Posted

Strange. Have you updated to 4.10.2? Has that helped?

Ladiesman0217
Posted

I just updated to that version and tested it out. Same results, unfortunately.

  • 3 weeks later...
Posted
On 10/30/2026 at 9:29 PM, Ladiesman0217 said:

I just updated to that version and tested it out. Same results, unfortunately.

Hi, are you still having an issue with this?

Ladiesman0217
Posted

I am. I just tried it again and still can't search for a Live TV channel name. It still only works for that one user I identified earlier.

  • 2 weeks later...
Posted

OK we'll have a 4.10.3 update out soon. Let's see how that compares once available. Thanks.

Ladiesman0217
Posted

Hey Luke, I just wanted to say that I was able to fix this, at least for my local instance. Here's a summary of what I found and how I fixed it:

Emby IPTV Search Bug - Root Cause & Fix

Bug Summary

IPTV search returns "No items matching your search criteria" for some accounts while working for others, even when all accounts have Live TV enabled and identical folder access permissions. The issue is caused by the Emby query builder generating different SQL WHERE clauses for accounts based on their historical folder access patterns.

Root Cause

Query Builder Bug: The search query builder generates different SQL WHERE clauses for different accounts based on their folder access hierarchy, not their current permissions.

Specific behavior:

  • Account with access to ONLY new IPTV folder (268391): Generates query with WHERE Type in (27, 28) ✅
  • Account with access to BOTH old folder (251) AND new folder (268391): Generates query with WHERE Type NOT in (27, 28) ❌

Why this happens: When an account is created, the query builder caches or generates a template based on which Live TV folders the user has access to. If a user has had access to multiple Live TV folder hierarchies (old + new), the query builder enters a "hybrid access" code path that incorrectly excludes IPTV channel types (27, 28) from search results.

Evidence from debug logs:

-- Working account (Secondary User - User 9):
WHERE A.Type in (27, 28) OR A.Type in (27, 28) OR ...

-- Broken account (Admin User - User 1):  
WHERE A.Type NOT in (27, 28) OR A.Type NOT in (27, 28) OR ...

Both accounts have Live TV enabled and identical current folder access, but generate opposite queries.

How to Reproduce

  1. Create Emby instance with Live TV

  2. Create Admin User account (User A)

  3. Add Live TV with M3U tuner + XMLTV guide

  4. Verify channels import successfully

  5. Create Secondary User account (User B)

  6. Enable Live TV in Secondary User's settings

  7. Both users can search IPTV ✅

  8. Now trigger the bug - Reconfigure Live TV:

    • Remove Live TV completely from Emby settings
    • Reconfigure Live TV with same/different M3U and XMLTV sources
    • BUG: Admin User can no longer search IPTV ❌
    • Secondary User can still search ✅

Why: Admin User now has access to both old folder and new folder, entering the "hybrid access" code path in the query builder.

How I Fixed It

Note: The following steps resolved the issue in this instance, but it is unknown if all steps were necessary or if some were redundant trial-and-error attempts.

  1. Deleted Live TV sources

    • Removed the M3U tuner source completely
    • Removed the XMLTV guide data source completely
  2. Cleaned up orphaned folder records

    • Deleted orphaned UserItemShares entries for deleted Live TV folder IDs
  3. Reconfigured Live TV sources

    • Reconfigured M3U tuner with same M3U data
    • Reconfigured XMLTV guide with same guide data
    • Channels failed to import on this attempt
  4. Cleaned up AncestorIds2 records

    • Deleted orphaned AncestorIds2 records where the AncestorId no longer existed in MediaItems
    • These records were preventing channel import
  5. Reconfigured Live TV sources again

    • Reconfigured M3U tuner and XMLTV guide again
    • Channel import completed successfully
  6. Restarted Emby container

    • Stopped and restarted the Emby service
    • After restart, all accounts could successfully search IPTV channels

Summary

The primary issue is a query builder bug in Emby's search logic that generates incorrect WHERE clauses for accounts with multi-level Live TV folder access, manifesting as IPTV search being completely non-functional for affected accounts. This bug is triggered when a user account has had access to multiple Live TV folder hierarchies over time.

 

 

Posted

Hi, we’ll look into that. Thanks for the info.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...