From 10311a767e9c22d0e5dbd4e2b1a82bf7690e2b53 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 8 Dec 2020 14:53:45 -0500 Subject: [PATCH] Update Guide Page with Conditional Play Link --- fHDHR_web/pages/guide_html.py | 11 ++++++++++- fHDHR_web/templates/guide.html | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/fHDHR_web/pages/guide_html.py b/fHDHR_web/pages/guide_html.py index 626eca7..7c70276 100644 --- a/fHDHR_web/pages/guide_html.py +++ b/fHDHR_web/pages/guide_html.py @@ -38,6 +38,15 @@ class Guide_HTML(): "listing_description": channel["listing"][0]["description"], "remaining_time": str(remaining_time) } + if source in ["blocks", "origin", self.fhdhr.config.dict["main"]["dictpopname"]]: + chan_obj = self.fhdhr.device.channels.get_channel_obj("origin_id", channel["id"]) + + chan_dict["name"] = chan_obj.dict["name"] + chan_dict["number"] = chan_obj.dict["number"] + chan_dict["chan_thumbnail"] = chan_obj.thumbnail + chan_dict["enabled"] = chan_obj.dict["enabled"] + chan_dict["play_url"] = chan_obj.play_url + chan_guide_list.append(chan_dict) - return render_template('guide.html', request=request, fhdhr=self.fhdhr, chan_guide_list=chan_guide_list, epg_methods=epg_methods) + return render_template('guide.html', request=request, fhdhr=self.fhdhr, chan_guide_list=chan_guide_list, epg_methods=epg_methods, source=source) diff --git a/fHDHR_web/templates/guide.html b/fHDHR_web/templates/guide.html index f42eb5c..64c0d77 100644 --- a/fHDHR_web/templates/guide.html +++ b/fHDHR_web/templates/guide.html @@ -12,6 +12,9 @@ + {% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %} + + {% endif %} @@ -23,6 +26,13 @@ {% for chan_dict in chan_guide_list %} + {% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %} + + {% endif %}
PlayChannel Name Channel Number Channel Thumbnail
+ {% if chan_dict["enabled"] %} + Play + {% endif %} + {{ chan_dict["name"] }} {{ chan_dict["number"] }} {{ chan_dict[