Skip to content

Commit

Permalink
Fix tests (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
mediaminister authored Apr 15, 2024
1 parent 26294d6 commit a95f99a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions resources/lib/playerinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def push_upnext(self):
def update_position(self):
"""Update the player position, when possible"""
try:
last_pos = self.getTime()
pos = self.getTime()
# Kodi Player sometimes returns a time of 0.0 and this causes unwanted behaviour with VRT MAX Resumepoints API.
if last_pos > 0.0:
self.last_pos = last_pos
if pos > 0.0:
self.last_pos = pos
except RuntimeError:
pass

Expand Down Expand Up @@ -244,9 +244,9 @@ def virtualsubclip_seektozero(self):
def update_total(self):
"""Update the total video time"""
try:
total = self.getTotalTime()
tot = self.getTotalTime()
# Kodi Player sometimes returns a total time of 0.0 and this causes unwanted behaviour with VRT MAX Resumepoints API.
if total > 0.0:
self.total = total
if tot > 0.0:
self.total = tot
except RuntimeError:
pass
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_get_api_data_specific_season(self):
title_items, sort, ascending, content = get_episodes(program_name='pano', season_name='2020')
self.assertEqual(len(title_items), 15)
self.assertEqual(sort, 'episode')
self.assertFalse(ascending)
self.assertTrue(ascending)
self.assertEqual(content, 'episodes')

def test_get_api_data_specific_season_without_broadcastdate(self):
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_episode_plot(self):
"""Test getting an episode plot (thuis)"""
title_items, sort, ascending, content = get_episodes(program_name='thuis', season_name='28')
self.assertEqual(sort, 'episode')
self.assertFalse(ascending)
self.assertTrue(ascending)
self.assertEqual(content, 'episodes')
plot = title_items[0].info_dict['plot']
print(kodi_to_ansi(plot))
Expand Down

0 comments on commit a95f99a

Please sign in to comment.