1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 12:16:58 -05:00

Update Guide Page with Conditional Play Link

This commit is contained in:
deathbybandaid 2020-12-08 14:53:45 -05:00
parent f8429883a6
commit 10311a767e
2 changed files with 20 additions and 1 deletions

View File

@ -38,6 +38,15 @@ class Guide_HTML():
"listing_description": channel["listing"][0]["description"], "listing_description": channel["listing"][0]["description"],
"remaining_time": str(remaining_time) "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) 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)

View File

@ -12,6 +12,9 @@
<table class="center" style="width:100%"> <table class="center" style="width:100%">
<tr> <tr>
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
<th>Play</th>
{% endif %}
<th>Channel Name</th> <th>Channel Name</th>
<th>Channel Number</th> <th>Channel Number</th>
<th>Channel Thumbnail</th> <th>Channel Thumbnail</th>
@ -23,6 +26,13 @@
{% for chan_dict in chan_guide_list %} {% for chan_dict in chan_guide_list %}
<tr> <tr>
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
<td>
{% if chan_dict["enabled"] %}
<a href="{{ chan_dict["play_url"] }}">Play</a>
{% endif %}
</td>
{% endif %}
<td>{{ chan_dict["name"] }}</td> <td>{{ chan_dict["name"] }}</td>
<td>{{ chan_dict["number"] }}</td> <td>{{ chan_dict["number"] }}</td>
<td><img src="{{ chan_dict["chan_thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td> <td><img src="{{ chan_dict["chan_thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td>