def __init__(self): super(VocaDBPlugin, self).__init__() self.base_url = 'http://vocadb.net' self.lg = lastgenre.LastGenrePlugin() self.config.add({ 'source_weight': 0.5, 'canonical_artists': True, 'separator': ', ', 'whitelist': True, 'artist_priority': ['producers', 'circles'], 'circles_exclude': [], 'genres': True, 'lang-priority': '' # 'Japanese, Romaji, English' }) self._log.debug('Querying VocaDB') self.lang = self.config['lang-priority'].get().split(',') if self.config['genres'].get(): self.import_stages = [self.imported]
def test_tags_for(self): class MockPylastElem(object): def __init__(self, name): self.name = name def get_name(self): return self.name class MockPylastObj(object): def get_top_tags(self): tag1 = Mock() tag1.weight = 90 tag1.item = MockPylastElem(u'Pop') tag2 = Mock() tag2.weight = 40 tag2.item = MockPylastElem(u'Rap') return [tag1, tag2] plugin = lastgenre.LastGenrePlugin() res = plugin._tags_for(MockPylastObj()) self.assertEqual(res, [u'pop', u'rap']) res = plugin._tags_for(MockPylastObj(), min_weight=50) self.assertEqual(res, [u'pop'])
def setUp(self): self.setup_beets() self.plugin = lastgenre.LastGenrePlugin()