diff --git a/fHDHR/device/channels/channel.py b/fHDHR/device/channels/channel.py index bf116e6..d65de02 100644 --- a/fHDHR/device/channels/channel.py +++ b/fHDHR/device/channels/channel.py @@ -153,7 +153,7 @@ class Channel(): 'GuideNumber': self.number, 'GuideName': self.dict['name'], 'Tags': ",".join(self.dict['tags']), - 'URL': self.stream_url, + 'URL': self.hdhr_stream_url, 'HD': self.dict["HD"], "Favorite": self.dict["favorite"], } @@ -163,11 +163,27 @@ class Channel(): return "/api/images?method=generate&type=channel&message=%s" % self.number @property - def stream_url(self): - return '/auto/v%s' % self.number + def hdhr_stream_url(self): + return '/auto/%s' % self.hdhr_stream_ident @property - def play_url(self): + def hdhr_stream_ident(self): + return 'v%s' % self.number + + @property + def rmg_stream_url(self): + return "/devices/%s/media/%s" % (self.fhdhr.config.dict["main"]["uuid"], self.rmg_stream_ident) + + @property + def rmg_stream_ident(self): + return "id://%s" % self.number + + @property + def api_stream_url(self): + return '/api/tuners?method=%s&channel=%s' % (self.fhdhr.config.dict["fhdhr"]["stream_type"], self.number) + + @property + def m3u_url(self): return '/api/m3u?method=get&channel=%s' % self.number def set_favorite(self, enablement): diff --git a/fHDHR_web/api/channels.py b/fHDHR_web/api/channels.py index 0cbfd9f..e1b1085 100644 --- a/fHDHR_web/api/channels.py +++ b/fHDHR_web/api/channels.py @@ -29,8 +29,8 @@ class Channels(): for fhdhr_id in [x["id"] for x in self.fhdhr.device.channels.get_channels()]: channel_obj = self.fhdhr.device.channels.list[fhdhr_id] channel_dict = channel_obj.dict.copy() - channel_dict["play_url"] = channel_obj.play_url - channel_dict["stream_url"] = channel_obj.stream_url + channel_dict["m3u_url"] = channel_obj.m3u_url + channel_dict["stream_url"] = channel_obj.api_stream_url channels_info[channel_obj.number] = channel_dict # Sort the channels diff --git a/fHDHR_web/api/m3u.py b/fHDHR_web/api/m3u.py index a427908..68291df 100644 --- a/fHDHR_web/api/m3u.py +++ b/fHDHR_web/api/m3u.py @@ -75,7 +75,7 @@ class M3U(): "tvg-logo": logourl, "group-title": self.fhdhr.config.dict["fhdhr"]["friendlyname"], "group-titleb": str(channel_obj.dict['name']), - "stream_url": "%s%s" % (base_url, channel_obj.stream_url) + "stream_url": "%s%s" % (base_url, channel_obj.api_stream_url) } # Sort the channels diff --git a/fHDHR_web/pages/channels_editor_html.py b/fHDHR_web/pages/channels_editor_html.py index 9043ae0..5b875ab 100644 --- a/fHDHR_web/pages/channels_editor_html.py +++ b/fHDHR_web/pages/channels_editor_html.py @@ -24,7 +24,7 @@ class Channels_Editor_HTML(): channel_dict["number"] = channel_obj.number channel_dict["chan_thumbnail"] = channel_obj.thumbnail - channel_dict["play_url"] = channel_obj.play_url + channel_dict["m3u_url"] = channel_obj.m3u_url channelslist[channel_dict["number"]] = channel_dict diff --git a/fHDHR_web/pages/channels_html.py b/fHDHR_web/pages/channels_html.py index 38c2066..f36f59a 100644 --- a/fHDHR_web/pages/channels_html.py +++ b/fHDHR_web/pages/channels_html.py @@ -29,7 +29,7 @@ class Channels_HTML(): channel_dict["number"] = channel_obj.number channel_dict["chan_thumbnail"] = channel_obj.thumbnail - channel_dict["play_url"] = channel_obj.play_url + channel_dict["m3u_url"] = channel_obj.m3u_url channelslist[channel_dict["number"]] = channel_dict if channel_dict["enabled"]: diff --git a/fHDHR_web/pages/guide_html.py b/fHDHR_web/pages/guide_html.py index 7736ca4..5f687b6 100644 --- a/fHDHR_web/pages/guide_html.py +++ b/fHDHR_web/pages/guide_html.py @@ -67,7 +67,7 @@ class Guide_HTML(): chan_dict["number"] = chan_obj.number chan_dict["chan_thumbnail"] = chan_obj.thumbnail chan_dict["enabled"] = chan_obj.dict["enabled"] - chan_dict["play_url"] = chan_obj.play_url + chan_dict["m3u_url"] = chan_obj.m3u_url chan_dict["listing_thumbnail"] = chan_dict["listing_thumbnail"] or chan_obj.thumbnail else: diff --git a/fHDHR_web/rmg/devices_devicekey_channels.py b/fHDHR_web/rmg/devices_devicekey_channels.py index c2c6f40..443ab06 100644 --- a/fHDHR_web/rmg/devices_devicekey_channels.py +++ b/fHDHR_web/rmg/devices_devicekey_channels.py @@ -27,7 +27,7 @@ class RMG_Devices_DeviceKey_Channels(): if channel_obj.enabled: sub_el(out, 'Channel', drm="0", - channelIdentifier="id://%s" % channel_obj.number, + channelIdentifier=channel_obj.rmg_stream_ident, name=channel_obj.dict["name"], origin=channel_obj.dict["callsign"], number=str(channel_obj.number), diff --git a/fHDHR_web/templates/channels.html b/fHDHR_web/templates/channels.html index 02ea9d7..3bf3b3e 100644 --- a/fHDHR_web/templates/channels.html +++ b/fHDHR_web/templates/channels.html @@ -48,9 +48,9 @@ {% if chan_dict["enabled"] %} - Play + Play {% else %} - Play + Play {% endif %} diff --git a/fHDHR_web/templates/guide.html b/fHDHR_web/templates/guide.html index 512825f..213fabf 100644 --- a/fHDHR_web/templates/guide.html +++ b/fHDHR_web/templates/guide.html @@ -35,9 +35,9 @@ {% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %} {% if chan_dict["enabled"] %} - Play + Play {% else %} - Play + Play {% endif %} {% endif %}