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

Merge pull request #82 from deathbybandaid/dev

Update Guide Page with Conditional Play Link
This commit is contained in:
Deathbybandaid 2020-12-08 14:55:44 -05:00 committed by GitHub
commit f9da9d8a72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -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)

View File

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