Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EPG method to return first program (not last) #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def Channel(channelId, container=False):
tagline = epg['title']

if Prefs['displayChannelIcons'] and 'icon_public_url' in channel:
thumb = Dict['url'] + '/' + channel['icon_public_url']
if channel['icon_public_url'].startswith('http'):
thumb = channel['icon_public_url']
else:
thumb = Dict['url'] + '/' + channel['icon_public_url']

if 'stop' in epg:
remaining_duration = (epg['stop'] - int(Datetime.TimestampFromDatetime(Datetime.Now())) + DURATION_ADDED) * 1000
Expand Down Expand Up @@ -203,7 +206,11 @@ def EPG(channelCount):
'/api/epg/events/grid',
values=dict(start=0, limit=channelCount)
)['entries']
return dict((channel['channelUuid'], channel) for channel in entries)
epg = dict()
for channel in entries:
if not channel['channelUuid'] in epg:
epg[channel['channelUuid']] = channel
return epg

@staticmethod
def fetch(path, headers=dict(), values=None):
Expand Down