Skip to content

Commit

Permalink
fix pylint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
piejanssens committed Nov 1, 2020
1 parent 8445e42 commit dd12fe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/lib/iptvmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def send_epg(self): # pylint: disable=no-method-argument,no-self-use
redbull = RedBullTV()

epg = defaultdict(list)

for item in redbull.get_epg().get('items'):
if item.get('start_time') and item.get('end_time') and re.match('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z', item.get('start_time')) and re.match('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z', item.get('end_time')):
if (item.get('start_time') and item.get('end_time') and re.match('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z', item.get('start_time')) and re.match('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z', item.get('end_time'))):
epg['redbulltv'].append(dict(
start=datetime.strptime(item.get('start_time'), "%Y-%m-%dT%H:%M:%S.%fZ").replace(tzinfo=UTC).isoformat(),
stop=datetime.strptime(item.get('end_time'), "%Y-%m-%dT%H:%M:%S.%fZ").replace(tzinfo=UTC).isoformat(),
Expand All @@ -73,6 +73,6 @@ def send_epg(self): # pylint: disable=no-method-argument,no-self-use
stream=url_for('play_uid', uid=item.get('id'))
))
else:
log("Invalid start or end time for Red Bull item ID {uid}".format(item.get('id')))
log("Invalid start or end time for Red Bull item ID {uid}".format(uid=item.get('id')))

return dict(version=1, epg=epg)

0 comments on commit dd12fe7

Please sign in to comment.