]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/meta.py
MPD client: Tries to resolve MusicBrainzArtistID when possible (fixed b36c71a)
[mpd-sima.git] / sima / lib / meta.py
index 9d15c69dacef0594f9bdcd7ecd76ac75f04b6c77..e6b9f46229554e008422017281de51db7d9be680 100644 (file)
@@ -27,7 +27,7 @@ import logging
 import re
 
 UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[89AB][a-f0-9]{3}-[a-f0-9]{12}$'
-# The Track Object is collapsing multiple tags into a single string using this
+#: The Track Object is collapsing multiple tags into a single string using this
 # separator. It is used then to split back the string to tags list.
 SEPARATOR = chr(0x1F)  # ASCII Unit Separator
 
@@ -136,12 +136,12 @@ class Meta:
 
         :param str other: Alias to add, could be any object with ``__str__`` method.
         """
+        if isinstance(other, Meta):
+            self.__aliases |= other.__aliases
+            self.__aliases -= {self.name}
         if getattr(other, '__str__', None):
             if callable(other.__str__) and other.__str__() != self.name:
                 self.__aliases |= {other.__str__()}
-        elif isinstance(other, Meta):
-            if other.name != self.name:
-                self.__aliases |= other.__aliases
         else:
             raise MetaException('No __str__ method found in {!r}'.format(other))