Skip to content

[BUG] tv_grab_zz_sdjson is outdated (XMLTV 1.3.0) and causes missing episode numbers #280

Description

@infidelus

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The LinuxServer Tvheadend Docker image currently ships XMLTV 1.3.0, including tv_grab_zz_sdjson 1.3.0.

When using the Schedules Direct SD-JSON grabber with UK listings, episode/season information can be missing from the generated XMLTV data.

For example, Schedules Direct provides the following metadata for Frasier:

programID: EP012597200187

metadata:
  Gracenote:
    season: 6
    episode: 23

However, the 1.3.0 version of tv_grab_zz_sdjson does not reliably process this metadata because it iterates over the metadata hash without resetting Perl's hash iterator.

The relevant code in the 1.3.0 version is:

metadata: for my $metadata (@{$details->{'metadata'}}) {
    while(my ($key, $value) = each %{$metadata}) {

The current upstream version contains an additional:

keys %{$metadata};

before the while loop, which fixes the problem.

I manually replaced /usr/bin/tv_grab_zz_sdjson in the running container with the current upstream version and ran the grabber through Tvheadend.

The resulting EPG now correctly shows season/episode information, including:

Frasier - Shutout in Seattle - S06E23
Frasier - Shutout in Seattle - S06E24
Frasier - Momma Mia - S07E01
Frasier - Father of the Bride - S07E02
Frasier - Radio Wars - S07E03

The corrected episode numbers are shown on both Channel 4 and Channel 4 HD.

Expected Behavior

The Docker image should ship a current version of XMLTV/tv_grab_zz_sdjson so that the Schedules Direct grabber correctly processes the season and episode metadata provided by the SD-JSON API.

In particular, tv_grab_zz_sdjson should include the upstream fix present in XMLTV 1.4.0 and correctly generate the XMLTV episode-num elements.

For example:

<episode-num system="xmltv_ns">5.22.0/2</episode-num>
<episode-num system="dd_progid">EP012597200187</episode-num>

for Frasier S06E23.

Steps To Reproduce

  1. Create/run a LinuxServer Tvheadend container using:

    lscr.io/linuxserver/tvheadend:latest
    
  2. Configure tv_grab_zz_sdjson as the XMLTV EPG grabber.

  3. Configure the grabber to use a Schedules Direct account and a UK lineup.

  4. Check the version inside the container:

    docker exec tvheadend /usr/bin/tv_grab_zz_sdjson --version
    

    The current image reports:

    XMLTV module version 1.3.0
    This is tv_grab_zz_sdjson version 1.3.0
    
  5. Run the XMLTV grabber and import the resulting guide into Tvheadend.

  6. Check programmes which have Gracenote season/episode metadata.

  7. Episode/season information is missing or incorrect in the resulting EPG.

  8. Replace /usr/bin/tv_grab_zz_sdjson in the container with the current upstream XMLTV version and run the same grab.

  9. The same programmes now correctly show their season and episode numbers in Tvheadend.

For example, Frasier episodes are displayed as S06E23, S06E24, S07E01, S07E02 and S07E03.

Environment

OS: Unraid 7.3.1

CPU architecture: x86-64

Docker image:
lscr.io/linuxserver/tvheadend:latest

LinuxServer image build:
fcd987f0-ls285
Build date: 2026-07-18T16:31:51+00:00

XMLTV version:
1.3.0

tv_grab_zz_sdjson version:
1.3.0

EPG source:
Schedules Direct SD-JSON

Affected channels:
Channel 4
Channel 4 HD

CPU architecture

x86-64

Docker creation

Docker created via Unraid's Apps function

Container logs

The issue does not produce an error in the Tvheadend container log.

The relevant diagnostic output is:

    $ docker exec tvheadend /usr/bin/tv_grab_zz_sdjson --version
    XMLTV module version 1.3.0
    This is tv_grab_zz_sdjson version 1.3.0

The grabber completes successfully and produces XMLTV data; the problem is that episode/season information is missing from some programmes.

After replacing /usr/bin/tv_grab_zz_sdjson with the current upstream version, the same grab completes successfully and Tvheadend displays the correct season/episode information.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions