"""
from .simastr import SimaStr
-from .track import Track
class MetaException(Exception):
"""Generic Meta Exception"""
else:
raise NotSameArtist('different mbids: {0} and {1}'.format(self, other))
-
-class TrackMB(Track):
-
- def __init__(self, **kwargs):
- super().__init__(**kwargs)
- if hasattr(self, 'musicbrainz_artistid'):
- self.artist = Artist(mbid=self.musicbrainz_artistid,
- name=self.artist)
-
# vim: ai ts=4 sw=4 sts=4 expandtab
# -*- coding: utf-8 -*-
-# Copyright (c) 2009, 2010, 2011, 2013 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2009, 2010, 2011, 2013, 2014 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
class Track:
"""
def __init__(self, file=None, time=0, pos=-1, **kwargs):
self.title = self.artist = self.album = self.albumartist = ''
+ self.musicbrainz_artistid = None
self.pos = int(pos)
self._empty = False
self._file = file
fmt = '%M:%S'
return time.strftime(fmt, temps)
+ def get_artist(self):
+ """Get artist object from track"""
+ return Artist(name=self.artist, mbid=self.musicbrainz_artistid)
+
# VIM MODLINE
# vim: ai ts=4 sw=4 sts=4 expandtab
if len(history) == 0:
break
trk = history.popleft()
- if (trk.artist in [trk.artist for trk in extra_arts]
- or trk.artist == current.artist):
+ if (trk.get_artist() in extra_arts
+ or trk.get_artist() == current.get_artist()):
continue
- extra_arts.append(trk)
+ extra_arts.append(trk.get_artist())
depth += 1
self.log.info('EXTRA ARTS: {}'.format(
- '/'.join([trk.artist for trk in extra_arts])))
+ '/'.join([art.name for art in extra_arts])))
for artist in extra_arts:
- self.log.debug(
- 'Looking for artist similar to "{0.artist}" as well'.format(
- artist))
+ self.log.debug('Looking for artist similar '
+ 'to "{}" as well'.format(artist))
similar = self.ws_similar_artists(artist=artist)
if not similar:
return ret_extra