- def __init__(self, **kwargs):
- self._aliases = set()
- super().__init__(**kwargs)
+ @mbidfilter
+ def __init__(self, name=None, mbid=None, **kwargs):
+ if kwargs.get('artist', False):
+ name = kwargs.get('artist').split(SEPARATOR)[0]
+ if kwargs.get('musicbrainz_artistid', False):
+ mbid = kwargs.get('musicbrainz_artistid').split(SEPARATOR)[0]
+ if (kwargs.get('albumartist', False) and
+ kwargs.get('albumartist') != 'Various Artists'):
+ name = kwargs.get('albumartist').split(SEPARATOR)[0]
+ if (kwargs.get('musicbrainz_albumartistid', False) and
+ kwargs.get('musicbrainz_albumartistid') != '89ad4ac3-39f7-470e-963a-56509c546377'):
+ mbid = kwargs.get('musicbrainz_albumartistid').split(SEPARATOR)[0]
+ super().__init__(name=name, mbid=mbid)
+
+class MetaContainer(Set):
+
+ def __init__(self, iterable):
+ self.elements = lst = []
+ for value in iterable:
+ if value not in lst:
+ lst.append(value)
+ else:
+ for inlst in lst:
+ if value == inlst:
+ inlst.add_alias(value)