Skip to content

Commit

Permalink
Fix tests (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
mediaminister authored Sep 8, 2021
1 parent 927599a commit 63db093
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ disable=
too-many-statements,
use-maxsplit-arg,
consider-using-from-import,
unspecified-encoding,

super-with-arguments, # Python 2.7 compatibility
raise-missing-from, # Python 2.7 compatibility
2 changes: 1 addition & 1 deletion resources/lib/modules/iptvmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def send_channels(self):
@via_socket
def send_epg(self):
""" Report EPG data """
results = dict()
results = {}

# Fetch EPG data
for date in ['yesterday', 'today', 'tomorrow']:
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/vtmgo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _request(method, url, params=None, form=None, data=None, token=None, profile
"""
if form or data:
# Make sure we don't log the password
debug_data = dict()
debug_data = {}
debug_data.update(form or data)
if 'password' in debug_data:
debug_data['password'] = '**redacted**'
Expand Down
10 changes: 5 additions & 5 deletions resources/lib/vtmgo/vtmgostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _extract_subtitles_from_stream_info(stream_info):
:type stream_info: dict
:rtype list[dict]
"""
subtitles = list()
subtitles = []
if stream_info.get('video').get('subtitles'):
for _, subtitle in enumerate(stream_info.get('video').get('subtitles')):
name = subtitle.get('language')
Expand Down Expand Up @@ -191,7 +191,7 @@ def _download_subtitles(subtitles):
if not kodiutils.exists(temp_dir):
kodiutils.mkdirs(temp_dir)

downloaded_subtitles = list()
downloaded_subtitles = []
for subtitle in subtitles:
output_file = temp_dir + subtitle.get('name')
webvtt_content = util.http_get(subtitle.get('url')).text
Expand All @@ -207,7 +207,7 @@ def _delay_webvtt_timing(match, ad_breaks):
:type ad_breaks: list[dict]
:rtype str
"""
sub_timings = list()
sub_timings = []
for timestamp in match.groups():
hours, minutes, seconds, millis = (int(x) for x in [timestamp[:-10], timestamp[-9:-7], timestamp[-6:-4], timestamp[-3:]])
sub_timings.append(timedelta(hours=hours, minutes=minutes, seconds=seconds, milliseconds=millis))
Expand Down Expand Up @@ -247,8 +247,8 @@ def _download_and_delay_subtitles(self, subtitles, json_manifest):
if not kodiutils.exists(temp_dir):
kodiutils.mkdirs(temp_dir)

ad_breaks = list()
delayed_subtitles = list()
ad_breaks = []
delayed_subtitles = []
webvtt_timing_regex = re.compile(r'\n(\d{2}:\d{2}:\d{2}\.\d{3}) --> (\d{2}:\d{2}:\d{2}\.\d{3})\s')

# Get advertising breaks info from json manifest
Expand Down

0 comments on commit 63db093

Please sign in to comment.