Commits

fab31 committed 4e5f21e

Fix a fix for a critical bug (that was a critical bug itself...)

  • Participants
  • Parent commits 709c421

Comments (0)

Files changed (1)

File zicbee_vlc/core.py

 __all__ = ['Player']
 
 from . import vlc
+import os
 
 class Player(object):
     _finished = False
         Player._finished = False
         e = self.p.event_manager()
         e.event_attach(vlc.EventType.MediaPlayerEndReached, self.__end_reached, None)
-        try:
-            if not ('://' in uri and not uri.startswith('file')) and self.p.will_play() != 1:
-                raise ValueError("Won't play")
-        except: # ValueError or any VLC Error
+        if (not '://' in uri or uri.startswith('file://')) and os.stat(uri).st_size < 100:
             self._finished = True
         else:
             self.p.play()