From 372792d09141b68f765a5cceff9ff79f11efbe68 Mon Sep 17 00:00:00 2001
From: John Bergqvist <31512273+JohnLBergqvist@users.noreply.github.com>
Date: Thu, 1 Jan 2026 14:17:11 +0000
Subject: [PATCH 1/3] Ensure the "hd720", "hd1080 & "damaged" flag icons
display for appropriate programs
---
modules/tv/tmpl/default/detail.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/tv/tmpl/default/detail.php b/modules/tv/tmpl/default/detail.php
index 673a477f..40059f76 100644
--- a/modules/tv/tmpl/default/detail.php
+++ b/modules/tv/tmpl/default/detail.php
@@ -275,6 +275,12 @@ function updateHomePage(item) {
echo '
';
if ($program->hdtv)
echo '
';
+ if ($program->hd_ready)
+ echo '
';
+ if ($program->fullhd)
+ echo '
';
+ if ($program->damaged)
+ echo '
';
if ($program->has_commflag)
echo '
';
if ($program->has_cutlist)
From 5c88c551a849816ec0cfd021f601a91ca6d2d8ea Mon Sep 17 00:00:00 2001
From: John Bergqvist <31512273+JohnLBergqvist@users.noreply.github.com>
Date: Thu, 1 Jan 2026 14:31:42 +0000
Subject: [PATCH 2/3] Update program flags to match what the backend now uses
---
modules/tv/classes/Program.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/tv/classes/Program.php b/modules/tv/classes/Program.php
index d84a3d9f..77a31835 100644
--- a/modules/tv/classes/Program.php
+++ b/modules/tv/classes/Program.php
@@ -79,7 +79,7 @@ class Program extends MythBase {
public function __construct($data) {
global $db;
- // This is a mythbackend-formatted program - info about this data structure is stored in libs/libmyth/programinfo.cpp
+ // This is a mythbackend-formatted program - info about this data structure is stored in libs/libmythtv/programtypeflags.h
if (!isset($data['chanid']) && isset($data[0])) {
// Load the remaining info we got from mythbackend
$this->title = trim($data[0]); # program name/title
@@ -144,8 +144,8 @@ public function __construct($data) {
$this->auto_expire = ($this->progflags & 0x00000004) ? true : false; // FL_AUTOEXP = 0x00000004
$this->is_editing = ($this->progflags & 0x00000008) ? true : false; // FL_EDITING = 0x00000008
$this->bookmark = ($this->progflags & 0x00000010) ? true : false; // FL_BOOKMARK = 0x00000010
- $this->is_recording = ($this->progflags & 0x00100000) ? true : false; // FL_INUSERECORDING = 0x00100000
- $this->is_playing = ($this->progflags & 0x00200000) ? true : false; // FL_INUSEPLAYING = 0x00200000
+ $this->is_recording = ($this->progflags & 0x01000000) ? true : false; // FL_INUSERECORDING = 0x01000000
+ $this->is_playing = ($this->progflags & 0x02000000) ? true : false; // FL_INUSEPLAYING = 0x02000000
$this->is_transcoded = ($this->progflags & 0x00000100) ? true : false; // FL_TRANSCODED = 0x00000100
$this->is_watched = ($this->progflags & 0x00000200) ? true : false; // FL_WATCHED = 0x00000200
// Can be deleted?
From 61e00bf0885f38d0c2f4e464b2d49d42fe48fee4 Mon Sep 17 00:00:00 2001
From: John Bergqvist <31512273+JohnLBergqvist@users.noreply.github.com>
Date: Thu, 1 Jan 2026 14:33:16 +0000
Subject: [PATCH 3/3] Correctly parse program properties whether they're
strings or bitflags
---
modules/tv/classes/Program.php | 70 ++++++++++++++++++++++++----------
1 file changed, 49 insertions(+), 21 deletions(-)
diff --git a/modules/tv/classes/Program.php b/modules/tv/classes/Program.php
index 77a31835..14f85671 100644
--- a/modules/tv/classes/Program.php
+++ b/modules/tv/classes/Program.php
@@ -184,29 +184,57 @@ public function __construct($data) {
$this->recordedid = $data['recordedid'];
// These db fields should really get renamed...
- $this->audioproperties = $data['stereo'];
- $this->videoproperties = $data['hdtv'];
- $this->subtitletype = $data['closecaptioned'];
+ $this->audioproperties = $data['audioprop'];
+ $this->videoproperties = $data['videoprop'];
+ $this->subtitletype = $data['subtitletypes'];
}
// Assign shortcut names to the new audio/video/subtitle property flags
- $this->stereo = $this->audioproperties & 0x01;
- $this->mono = $this->audioproperties & 0x02;
- $this->surround = $this->audioproperties & 0x04;
- $this->dolby = $this->audioproperties & 0x08;
- $this->audiohardhear = $this->audioproperties & 0x10;
- $this->audiovisimpair = $this->audioproperties & 0x20;
-
- $this->widescreen = $this->videoproperties & 0x0001;
- $this->hdtv = $this->videoproperties & 0x0002;
- $this->avc = $this->videoproperties & 0x0008;
- $this->hd_ready = $this->videoproperties & 0x0020;
- $this->fullhd = $this->videoproperties & 0x0040;
- $this->damaged = $this->videoproperties & 0x0400;
-
- $this->closecaptioned = $this->subtitletype & 0x01;
- $this->has_subtitles = $this->subtitletype & 0x02;
- $this->subtitled = $this->subtitletype & 0x04;
- $this->deaf_signed = $this->subtitletype & 0x08;
+ // Check if properties are strings (From MySQL SET columns) or numeric bitflags
+ if (!empty($this->audioproperties) && !is_numeric($this->audioproperties)) {
+ // Parse comma-separated string values from MySQL SET columns
+ $this->stereo = strpos($this->audioproperties, 'STEREO') !== false;
+ $this->mono = strpos($this->audioproperties, 'MONO') !== false;
+ $this->surround = strpos($this->audioproperties, 'SURROUND') !== false;
+ $this->dolby = strpos($this->audioproperties, 'DOLBY') !== false;
+ $this->audiohardhear = strpos($this->audioproperties, 'HARDHEAR') !== false;
+ $this->audiovisimpair = strpos($this->audioproperties, 'VISUALIMPAIR') !== false;
+ } elseif (is_numeric($this->audioproperties)) {
+ // Parse numeric bitflags from mythproto (could be string '75' or int 75)
+ $this->stereo = intval($this->audioproperties) & 0x01;
+ $this->mono = intval($this->audioproperties) & 0x02;
+ $this->surround = intval($this->audioproperties) & 0x04;
+ $this->dolby = intval($this->audioproperties) & 0x08;
+ $this->audiohardhear = intval($this->audioproperties) & 0x10;
+ $this->audiovisimpair = intval($this->audioproperties) & 0x20;
+ }
+
+ if (!empty($this->videoproperties) && !is_numeric($this->videoproperties)) {
+ $this->widescreen = strpos($this->videoproperties, 'WIDESCREEN') !== false;
+ $this->hdtv = strpos($this->videoproperties, 'HDTV') !== false;
+ $this->avc = strpos($this->videoproperties, 'AVC') !== false;
+ $this->hd_ready = strpos($this->videoproperties, '720') !== false;
+ $this->fullhd = strpos($this->videoproperties, '1080') !== false;
+ $this->damaged = strpos($this->videoproperties, 'DAMAGED') !== false;
+ } elseif (is_numeric($this->videoproperties)) {
+ $this->widescreen = intval($this->videoproperties) & 0x0001;
+ $this->hdtv = intval($this->videoproperties) & 0x0002;
+ $this->avc = intval($this->videoproperties) & 0x0008;
+ $this->hd_ready = intval($this->videoproperties) & 0x0020;
+ $this->fullhd = intval($this->videoproperties) & 0x0040;
+ $this->damaged = intval($this->videoproperties) & 0x0400;
+ }
+
+ if (!empty($this->subtitletype) && !is_numeric($this->subtitletype)) {
+ $this->closecaptioned = strpos($this->subtitletype, 'HARDHEAR') !== false;
+ $this->has_subtitles = strpos($this->subtitletype, 'NORMAL') !== false;
+ $this->subtitled = strpos($this->subtitletype, 'ONSCREEN') !== false;
+ $this->deaf_signed = strpos($this->subtitletype, 'SIGNED') !== false;
+ } elseif (is_numeric($this->subtitletype)) {
+ $this->closecaptioned = intval($this->subtitletype) & 0x01;
+ $this->has_subtitles = intval($this->subtitletype) & 0x02;
+ $this->subtitled = intval($this->subtitletype) & 0x04;
+ $this->deaf_signed = intval($this->subtitletype) & 0x08;
+ }
// Generate the star string, since mysql has issues with REPEAT() and
// decimals, and the backend doesn't do it for us, anyway.
$this->starstring = @str_repeat(star_character, intVal($this->stars * max_stars));