Example #1
0
class CoverartOptionsPage(OptionsPage):

    NAME = "coverart"
    TITLE = "Cover Art"
    PARENT = "plugins"

    options = [
        BoolOption("setting", "Coverart_use_track_tags", False),
        BoolOption("setting", "Coverart_use_artist_tags", False),
        #BoolOption("setting", "Coverart_use_artist_images", False),
        IntOption("setting", "Coverart_min_tag_usage", 15),
        TextOption("setting", "Coverart_ignore_tags", "seen live,favorites"),
        TextOption("setting", "Coverart_join_tags", ""),
    ]

    def __init__(self, parent=None):
        super(CoverartOptionsPage, self).__init__(parent)
        self.ui = Ui_CoverartOptionsPage()
        self.ui.setupUi(self)

    def load(self):
        self.ui.use_track_tags.setChecked(self.config.setting["Coverart_use_track_tags"])
        self.ui.use_artist_tags.setChecked(self.config.setting["Coverart_use_artist_tags"])
        #self.ui.use_artist_images.setChecked(self.config.setting["Coverart_use_artist_images"])
        self.ui.min_tag_usage.setValue(self.config.setting["Coverart_min_tag_usage"])
        self.ui.ignore_tags.setText(self.config.setting["Coverart_ignore_tags"])
        self.ui.join_tags.setEditText(self.config.setting["Coverart_join_tags"])

    def save(self):
        self.config.setting["Coverart_use_track_tags"] = self.ui.use_track_tags.isChecked()
        self.config.setting["Coverart_use_artist_tags"] = self.ui.use_artist_tags.isChecked()
        #self.config.setting["Coverart_use_artist_images"] = self.ui.use_artist_images.isChecked()
        self.config.setting["Coverart_min_tag_usage"] = self.ui.min_tag_usage.value()
        self.config.setting["Coverart_ignore_tags"] = unicode(self.ui.ignore_tags.text())
        self.config.setting["Coverart_join_tags"] = unicode(self.ui.join_tags.currentText())
Example #2
0
 def __init__(self, parent=None):
     super(CoverartOptionsPage, self).__init__(parent)
     self.ui = Ui_CoverartOptionsPage()
     self.ui.setupUi(self)