예제 #1
0
 def run(self):
   device = self.config.setting["cd_lookup_device"].split(",", 1)[0]
   disc = Disc()
   disc.read(encode_filename(device))
   self.discid = disc.id
   self.log.debug('CD has discid: %s', disc.id)
   self.rip()
   result = self.widget.exec_()
   if result == self.widget.Rejected:
     self._cleanup()
예제 #2
0
    def lookup_cd(self, action=None):
        """Reads CD from the selected drive and tries to lookup the DiscID on MusicBrainz."""
        if action is None:
            device = self.config.setting["cd_lookup_device"].split(",", 1)[0]
        else:
            device = unicode(action.text())

        disc = Disc()
        self.set_wait_cursor()
        self.other_queue.put((partial(disc.read, encode_filename(device)),
                              partial(self._lookup_disc,
                                      disc), QtCore.Qt.LowEventPriority))
예제 #3
0
    def lookup_cd(self, action):
        """Reads CD from the selected drive and tries to lookup the DiscID on MusicBrainz."""
        if isinstance(action, QtWidgets.QAction):
            device = action.text()
        elif config.setting["cd_lookup_device"] != '':
            device = config.setting["cd_lookup_device"].split(",", 1)[0]
        else:
            # rely on python-discid auto detection
            device = None

        disc = Disc()
        self.set_wait_cursor()
        thread.run_task(partial(disc.read, encode_filename(device)),
                        partial(self._lookup_disc, disc))