Improve Config Structure for sources
This commit is contained in:
@@ -9,9 +9,8 @@ class SearchAPIPlugin(BeetsPlugin):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(SearchAPIPlugin, self).__init__()
|
super(SearchAPIPlugin, self).__init__()
|
||||||
self.config.add({
|
config.add({
|
||||||
'auto': True, # Enables or disables the plugin
|
'preferred_sources': [ '*' ],
|
||||||
'preferred': [ '*' ],
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -20,7 +19,7 @@ class SearchAPIPlugin(BeetsPlugin):
|
|||||||
them as regular expressions and returns a list
|
them as regular expressions and returns a list
|
||||||
of the resulting Patterns.
|
of the resulting Patterns.
|
||||||
"""
|
"""
|
||||||
preferences = self.config['preferred'].get()
|
preferences = config['preferred_sources'].as_str_seq()
|
||||||
return [re.compile('.*') if item == '*' else re.compile(item) for item in preferences]
|
return [re.compile('.*') if item == '*' else re.compile(item) for item in preferences]
|
||||||
|
|
||||||
def album_distance(self, items, album_info, mapping):
|
def album_distance(self, items, album_info, mapping):
|
||||||
|
|||||||
Reference in New Issue
Block a user