Skip to content

Commit

Permalink
Retry before giving up retrieving item length (possible fix for #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneDae committed Feb 19, 2019
1 parent 5ceaf8e commit e4f6170
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vlcscheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ async def player_coro(player, rebuild_events_queue, extra_items_queue):
player.add(item.path)

if play_duration == 0:
await asyncio.sleep(0.25)
play_duration = player.status().get('length', 0)
for i in range(0, 4):
await asyncio.sleep(0.25)
if player.status().get('state', None) == 'playing':
play_duration = player.status().get('length', 0)
break

if play_duration <= 0:
play_duration = config.IMAGE_PLAY_DURATION
Expand Down

0 comments on commit e4f6170

Please sign in to comment.