Exemple #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 = update_id3(bean)

            beans.append(bean)
Exemple #2
0
 def change_rows_by_path(self, file_paths):
     for treerow in self.model:
         if treerow[self.is_file[0]] and treerow[self.path[0]] in file_paths:
             bean = self.get_bean_from_row(treerow)
             bean = update_id3(bean)
             row_ref = Gtk.TreeRowReference.new(self.model, treerow.path)
             self.fill_row(row_ref, bean)
     GLib.idle_add(self.controls.notetabs.save_current_tab, priority=GLib.PRIORITY_LOW)
Exemple #3
0
 def change_rows_by_path(self, file_paths):
     for treerow in self.model:
         if treerow[self.is_file[0]] and treerow[self.path[0]] in file_paths:
             bean = self.get_bean_from_row(treerow)
             bean = update_id3(bean)
             row_ref = Gtk.TreeRowReference.new(self.model, treerow.path)
             self.fill_row(row_ref, bean)
     GLib.idle_add(self.controls.notetabs.save_current_tab, priority=GLib.PRIORITY_LOW)