From 794732aceefb6c145e592a88fd8200318bc2a4b7 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Wed, 20 Dec 2023 10:00:39 +0100 Subject: [PATCH] fix: default factory raised type error --- src/create_custom_objects.py | 3 ++- src/music_kraken/objects/collection.py | 1 - src/music_kraken/objects/song.py | 19 +------------------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/create_custom_objects.py b/src/create_custom_objects.py index c8f0052..a6b178a 100644 --- a/src/create_custom_objects.py +++ b/src/create_custom_objects.py @@ -13,6 +13,7 @@ from music_kraken.objects.lint_default_factories import lint lint() +""" song = Song(title="Sad Story", isrc="testTest") other_song = Song(title="hihi", genre="dsbm") @@ -29,8 +30,8 @@ print(other_song.__dict__) print(song) print(type(song).__dict__["__annotations__"]) +""" -exit() only_smile = Artist( name="Only Smile", source_list=[Source(SourcePages.BANDCAMP, "https://onlysmile.bandcamp.com/")], diff --git a/src/music_kraken/objects/collection.py b/src/music_kraken/objects/collection.py index a16d64f..a3bd8a4 100644 --- a/src/music_kraken/objects/collection.py +++ b/src/music_kraken/objects/collection.py @@ -144,7 +144,6 @@ class Collection(Generic[T]): 2. merge into existing object 3. remap existing object """ - self = self.__self__ if __object.id in self._contains_ids: return diff --git a/src/music_kraken/objects/song.py b/src/music_kraken/objects/song.py index c870150..348c70c 100644 --- a/src/music_kraken/objects/song.py +++ b/src/music_kraken/objects/song.py @@ -393,23 +393,6 @@ All objects dependent on Artist class Artist(Base): - COLLECTION_STRING_ATTRIBUTES = ( - "feature_song_collection", - "main_album_collection", - "label_collection", - "source_collection" - ) - SIMPLE_STRING_ATTRIBUTES = { - "name": None, - "unified_name": None, - "country": None, - "formed_in": ID3Timestamp(), - "notes": FormattedText(), - "lyrical_themes": [], - "general_genre": "", - "unformated_location": None, - } - name: str unified_name: str country: Country @@ -441,7 +424,7 @@ class Artist(Base): "name": lambda: None, "unified_name": lambda: None, - "country": Country, + "country": lambda: None, "unformated_location": lambda: None, }