]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/meta.py
MPD client: Tries to resolve MusicBrainzArtistID when possible.
[mpd-sima.git] / sima / lib / meta.py
index 9d15c69dacef0594f9bdcd7ecd76ac75f04b6c77..5a2305eceb09169663860083bc43b3122a03e4ab 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
 
@@ -158,6 +158,13 @@ class Meta:
     def mbid(self):
         return self.__mbid
 
+    @mbid.setter
+    def mbid(self, mbid):
+        if mbid and not is_uuid4(mbid):
+            self.log.warning('Wrong mbid %s:%s', self.__name, mbid)
+            return
+        self.__mbid = mbid
+
     @property
     def aliases(self):
         return self.__aliases