diff --git a/discodos/model_collection.py b/discodos/model_collection.py index 0f60859..f30657b 100644 --- a/discodos/model_collection.py +++ b/discodos/model_collection.py @@ -15,15 +15,8 @@ log = logging.getLogger('discodos') - -class Collection (Database): # pylint: disable=too-many-public-methods - """Discogs record collection class.""" - def __init__(self, db_conn, db_file=False): - super().__init__(db_conn, db_file) - self.d = False - self.me = False - self.ONLINE = False # set True by discogs_connect method - +class DiscogsConnectMixin: + """Discogs connection method.""" def discogs_connect(self, _userToken, _appIdentifier): """Discogs connect try,except wrapper sets attributes d, me and ONLINE. """ @@ -37,6 +30,15 @@ def discogs_connect(self, _userToken, _appIdentifier): self.ONLINE = False return self.ONLINE + +class Collection (Database, DiscogsConnectMixin): # pylint: disable=too-many-public-methods + """Discogs record collection class.""" + def __init__(self, db_conn, db_file=False): + super().__init__(db_conn, db_file) + self.d = False + self.me = False + self.ONLINE = False # set True by discogs_connect method + def get_all_db_releases(self, orderby='d_artist, discogs_title'): # return db.all_releases(self.db_conn) return self._select_simple(