Ejemplo n.º 1
0
    def _play(self, bean):

        self.count_errors = 0

        if not bean.path:
            bean.path = get_bean_posible_paths(bean)

        if bean.path and bean.type != FTYPE_RADIO and bean.path.startswith(
                "http"):
            if not url_utils.is_exists(bean.path):
                bean.path = None

        if not bean.path:
            if not self.fill_bean_from_vk(bean):
                if self.vk_service.is_show_authorization():
                    return None

                if self.count_errors < 4:
                    time.sleep(0.5)
                    self.count_errors += 1
                    self.next()

        if bean.path and os.path.isdir(bean.path):
            return None

        self.media_engine.play(bean)
        self.is_scrobbled = False
        self.start_time = False

        if not get_file_extension(bean.path) in FC().video_formats:
            self.update_info_panel(bean)
            self.set_visible_video_panel(False)
Ejemplo n.º 2
0
 def _play(self, bean):
     
     
     self.count_errors = 0
     
     if not bean.path:
         bean.path = get_bean_posible_paths(bean)
     
     if bean.path and bean.type != FTYPE_RADIO and bean.path.startswith("http"):
         if not url_utils.is_exists(bean.path):
             bean.path = None
     
     if not bean.path:            
         if not self.fill_bean_from_vk(bean):
             if self.vk_service.is_show_authorization():
                 return None
                 
             if self.count_errors < 4:
                 time.sleep(0.5)
                 self.count_errors += 1
                 self.next()
        
     if bean.path and os.path.isdir(bean.path):
         return None
     
     self.media_engine.play(bean)  
     self.is_scrobbled = False
     self.start_time = False      
     
     if not get_file_extension(bean.path) in FC().video_formats:
         self.update_info_panel(bean)
         self.set_visible_video_panel(False)
Ejemplo n.º 3
0
 def _play(self, bean):
     self.count_errors = 0
     
     if not bean.path:
         bean.path = get_bean_posible_paths(bean)
     
     if bean.path and bean.type != FTYPE_RADIO and bean.path.startswith("http"):
         if not url_utils.is_exists(bean.path):
             bean.path = None
     
     if not bean.path:            
         if not self.fill_bean_from_vk(bean):
             def post_task():
                 self._play(bean)
             if self.vk_service.is_show_authorization(post_task):
                 return None
                 
             if self.count_errors < 4:
                 time.sleep(0.5)
                 self.count_errors += 1
                 if self.play_lock.locked():
                     self.play_lock.release()
                 self.next()
        
     if bean.path:
         if not os.path.exists(bean.path):
             if bean.iso_path and os.path.exists(bean.iso_path):
                 logging.info("Try to remount " + bean.iso_path)
                 mount_tmp_iso(bean.iso_path)
             elif not bean.path.startswith("http"):
                 logging.error("File " + bean.path + " not found")
         elif os.path.isdir(bean.path):
                 return None
     self.media_engine.play(bean)
     self.is_scrobbled = False
     self.start_time = False      
     
     if not get_file_extension(bean.path) in FC().video_formats:
         if bean.type != FTYPE_RADIO:
             self.update_info_panel(bean)
         self.set_visible_video_panel(False)