示例#1
0
 def __init__(self):
     super(save_and_rewrite_header, self).__init__()
     register_file_action(self)
     register_track_action(self)
     register_album_action(self)
     register_cluster_action(self)
     register_clusterlist_action(self)
示例#2
0
	def __init__(self):
		super(NiCeFileAction, self).__init__()
		register_file_action(self)
		register_track_action(self)
		register_album_action(self)
		register_cluster_action(self)
		register_clusterlist_action(self)
 def __init__(self):
     super(save_and_rewrite_header, self).__init__()
     register_file_action(self)
     register_track_action(self)
     register_album_action(self)
     register_cluster_action(self)
     register_clusterlist_action(self)
示例#4
0
        for track in tracks:
            nat = self.tagger.load_nat(
                track.metadata['musicbrainz_recordingid'])
            for file in track.iterfiles():
                file.move(nat)
                metadata = file.metadata
                metadata.delete('albumartist')
                metadata.delete('albumartistsort')
                metadata.delete('albumsort')
                metadata.delete('asin')
                metadata.delete('barcode')
                metadata.delete('catalognumber')
                metadata.delete('discnumber')
                metadata.delete('discsubtitle')
                metadata.delete('media')
                metadata.delete('musicbrainz_albumartistid')
                metadata.delete('musicbrainz_albumid')
                metadata.delete('musicbrainz_discid')
                metadata.delete('musicbrainz_releasegroupid')
                metadata.delete('releasecountry')
                metadata.delete('releasestatus')
                metadata.delete('releasetype')
                metadata.delete('totaldiscs')
                metadata.delete('totaltracks')
                metadata.delete('tracknumber')
                log.debug("[LoadAsNat] deleted tags: %r",
                          metadata.deleted_tags)


register_track_action(LoadAsNat())
示例#5
0
                if len(value) == 1 and value[0] != '':
                    value = value[0]
                else:
                    value = repr(value)
                value_item.setText(value)

    def add_separator_row(self, table, i, title):
        key_item, value_item = self.get_table_items(table, i)
        font = key_item.font()
        font.setBold(True)
        key_item.setFont(font)
        key_item.setText(title)

    def get_table_items(self, table, i):
        key_item = table.item(i, 0)
        value_item = table.item(i, 1)
        if not key_item:
            key_item = QtWidgets.QTableWidgetItem()
            key_item.setFlags(self.key_flags)
            table.setItem(i, 0, key_item)
        if not value_item:
            value_item = QtWidgets.QTableWidgetItem()
            value_item.setFlags(self.value_flags)
            table.setItem(i, 1, value_item)
        return key_item, value_item


vv = ViewVariables()
register_file_action(vv)
register_track_action(vv)
示例#6
0
                value = dict.get(metadata, key)
                if len(value) == 1 and value[0] != '':
                    value = value[0]
                else:
                    value = repr(value)
                value_item.setText(value)

    def add_separator_row(self, table, i, title):
        key_item, value_item = self.get_table_items(table, i)
        font = key_item.font()
        font.setBold(True)
        key_item.setFont(font)
        key_item.setText(title)

    def get_table_items(self, table, i):
        key_item = table.item(i, 0)
        value_item = table.item(i, 1)
        if not key_item:
            key_item = QtGui.QTableWidgetItem()
            key_item.setFlags(self.key_flags)
            table.setItem(i, 0, key_item)
        if not value_item:
            value_item = QtGui.QTableWidgetItem()
            value_item.setFlags(self.value_flags)
            table.setItem(i, 1, value_item)
        return key_item, value_item

vv = ViewVariables()
register_file_action(vv)
register_track_action(vv)
示例#7
0
    def update_list(self, current_item=None):
        current_row = -1
        self.ui.list_providers.clear()
        for counter, provider_id in enumerate(self.providers):
            item = QtWidgets.QListWidgetItem()
            item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
            item.setText(self.providers[provider_id]['name'])
            item.setCheckState(QtCore.Qt.Checked if provider_id == self.provider else QtCore.Qt.Unchecked)
            item.setData(QtCore.Qt.UserRole, provider_id)
            self.ui.list_providers.addItem(item)
            if current_item and provider_id == current_item:
                current_row = counter
        current_row = max(current_row, 0)
        self.ui.list_providers.setCurrentRow(current_row)
        self.ui.list_providers.sortItems()

    def save(self):
        self._set_settings(config.setting)

    def _set_settings(self, settings):
        settings[KEY_PROVIDER] = self.provider.strip()
        settings[KEY_EXTRA] = self.additional_words.strip()
        settings[KEY_PROVIDERS] = self.providers or DEFAULT_PROVIDERS.copy()


register_cluster_action(SearchEngineLookupTest())
register_options_page(SearchEngineLookupOptionsPage)
register_album_action(AlbumCoverArtLookup())
register_track_action(TrackCoverArtLookup())