# -*- coding: utf-8 -*-
-# Copyright (c) 2009, 2010, 2011, 2013, 2014 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2009, 2010, 2011, 2013, 2014, 2015 Jack Kaliko <kaliko@azylum.org>
# Copyright (c) 2009 J. Alexander Treuman (Tag collapse method)
# Copyright (c) 2008 Rick van Hattem
#
import time
-from .meta import Artist
+from .meta import Artist, SEPARATOR
class Track:
"""
continue
if isinstance(value, list):
self.collapsed_tags.append(tag)
- self.__dict__.update({tag: ', '.join(set(value))})
+ self.__dict__.update({tag: SEPARATOR.join(set(value))})
def __repr__(self):
- return '%s(artist="%s", album="%s", title="%s", filename="%s")' % (
+ return '%s(artist="%s", album="%s", title="%s", file="%s")' % (
self.__class__.__name__,
self.artist,
self.album,
return hash(self) != hash(other)
def __bool__(self):
+ if not self._file:
+ return False
return not self._empty
@property
@property
def Artist(self):
"""Get artist object from track"""
+ if not self.artist:
+ if not self.musicbrainz_artistid:
+ return Artist(name='[unknown]',
+ mbid='125ec42a-7229-4250-afc5-e057484327fe')
+ return Artist(name='[unknown]', **self.__dict__)
return Artist(**self.__dict__)
# VIM MODLINE