Ejemplo n.º 1
0
 def get_common_beans(self):
     beans = []
     cue = self.parse()
     if not self.is_cue_valid():
         return []
     for i, track  in enumerate(cue.tracks):
         bean = FModel(text=track.performer + " - " + track.title, path=track.path)
         bean.artist = track.performer
         bean.tracknumber = i + 1
         bean.title = track.title
         bean.album = self.cue_file.title
         bean.name = bean.text
         bean.start_sec = track.get_start_time_sec()
         bean.duration_sec = track.duration
         bean.time = convert_seconds_to_text(track.duration)
         bean.is_file = True
         try:
             bean.info = foobnix.util.id3_util.normalized_info(get_mutagen_audio(track.path).info, bean)
         except Exception, e:
             logging.warn(str(e) + " " + bean.path)
             bean.info = ""
                                    
         if not bean.title or not bean.artist:
             bean = udpate_id3(bean)
         
         beans.append(bean)
Ejemplo n.º 2
0
 def get_common_beans(self):
     beans = []
     cue = self.parse()
     if not self.is_cue_valid():
         return []
     for i, track  in enumerate(cue.tracks):
         bean = FModel(text=track.performer + " - " + track.title, path=track.path)
         bean.artist = track.performer
         bean.tracknumber = i + 1
         bean.title = track.title
         bean.album = self.cue_file.title
         bean.name = bean.text
         bean.start_sec = track.get_start_time_sec()
         bean.duration_sec = track.duration
         bean.time = convert_seconds_to_text(track.duration)
         bean.is_file = True
         try:
             bean.info = foobnix.util.id3_util.normalized_info(get_mutagen_audio(track.path).info, bean)
         except Exception, e:
             logging.warn(str(e) + " " + bean.path)
             bean.info = ""
                                    
         if not bean.title or not bean.artist:
             bean = udpate_id3(bean)
         
         beans.append(bean)
Ejemplo n.º 3
0
 def task():
     for line in self.controls.vk_service.get_result('audio.get',"uid="+parent.user_id):
         logging.debug(line);
         bean = FModel(line['artist']+' - '+line['title'])
         
         bean.aritst = line['artist']
         bean.title = line['title']
         bean.time = convert_seconds_to_text(line['duration'])
         bean.path = line['url']
         bean.is_file = True
         
         row = self.get_row_from_bean(bean);
         self.model.append(p_iter, row)
     
     for rem in old_iters:
         self.model.remove(rem)   
Ejemplo n.º 4
0
        def task():
            for line in self.controls.vk_service.get_result(
                    'audio.get', "uid=" + parent.user_id):
                logging.debug(line)
                bean = FModel(line['artist'] + ' - ' + line['title'])

                bean.aritst = line['artist']
                bean.title = line['title']
                bean.time = convert_seconds_to_text(line['duration'])
                bean.path = line['url']
                bean.is_file = True

                row = self.get_row_from_bean(bean)
                self.model.append(p_iter, row)

            for rem in old_iters:
                self.model.remove(rem)
Ejemplo n.º 5
0
 def get_common_beans(self):
     beans = []
     cue = self.parse()
     if not self.is_cue_valid():
         return []
     for i, track  in enumerate(cue.tracks):
         bean = FModel(text=track.performer + " - " + track.title, path=track.path)
         bean.artist = track.performer
         bean.tracknumber = i + 1
         bean.title = track.title
         bean.name = bean.text
         bean.start_sec = track.get_start_time_sec()
         bean.duration_sec = track.duration
         bean.time = convert_seconds_to_text(track.duration)
         bean.is_file = True
         beans.append(bean)
     
     return beans