Compare commits

..

No commits in common. "1ef4b27f288e52868c8404f255358817e685f6a4" and "49c37345260e9873c1e387bbc7c15f1ed3bc36b8" have entirely different histories.

View File

@ -8,7 +8,7 @@ import copy
import pycountry
from ..utils.enums.album import AlbumType, AlbumStatus
from .collection import Collection, AppendHookArguments
from .collection import Collection
from .formatted_text import FormattedText
from .lyrics import Lyrics
from .contact import Contact
@ -144,14 +144,6 @@ class Song(Base):
UPWARDS_COLLECTION_STRING_ATTRIBUTES = ("artist_collection", "feature_artist_collection", "album_collection")
TITEL = "title"
@staticmethod
def register_artwork_parent(append_hook_arguments: AppendHookArguments):
album: Album = append_hook_arguments.new_object
song: Song
for song in append_hook_arguments.collection_root_objects:
song.artwork.parent_artworks.add(album.artwork)
def __init_collections__(self) -> None:
self.feature_artist_collection.push_to = [self.artist_collection]
self.artist_collection.pull_from = [self.feature_artist_collection]
@ -169,7 +161,6 @@ class Song(Base):
self.feature_artist_collection.extend_object_to_attribute = {
"album_collection": self.album_collection
}
self.album_collection.append_callbacks = set((Song.register_artwork_parent, ))
def _add_other_db_objects(self, object_type: Type[OuterProxy], object_list: List[OuterProxy]):
if object_type is Song:
@ -258,7 +249,6 @@ class Album(Base):
albumsort: int
notes: FormattedText
artwork: Artwork
source_collection: SourceCollection
song_collection: Collection[Song]
@ -278,7 +268,6 @@ class Album(Base):
"date": ID3Timestamp,
"notes": FormattedText,
"artwork": lambda: Artwork(crop_images=False),
"source_collection": SourceCollection,
"song_collection": Collection,
@ -301,7 +290,6 @@ class Album(Base):
barcode: str = None,
albumsort: int = None,
notes: FormattedText = None,
artwork: Artwork = None,
source_list: List[Source] = None,
artist_list: List[Artist] = None,
song_list: List[Song] = None,
@ -316,13 +304,6 @@ class Album(Base):
DOWNWARDS_COLLECTION_STRING_ATTRIBUTES = ("song_collection",)
UPWARDS_COLLECTION_STRING_ATTRIBUTES = ("label_collection", "artist_collection")
@staticmethod
def register_artwork_parent(append_hook_arguments: AppendHookArguments):
song: Song = append_hook_arguments.new_object
for root_object in append_hook_arguments.collection_root_objects:
song.artwork.parent_artworks.add(root_object.artwork)
def __init_collections__(self):
self.feature_artist_collection.push_to = [self.artist_collection]
self.artist_collection.pull_from = [self.feature_artist_collection]
@ -341,8 +322,6 @@ class Album(Base):
"label_collection": self.label_collection
}
self.song_collection.append_callbacks = set((Album.register_artwork_parent, ))
def _add_other_db_objects(self, object_type: Type[OuterProxy], object_list: List[OuterProxy]):
if object_type is Song:
self.song_collection.extend(object_list)
@ -498,7 +477,7 @@ class Artist(Base):
general_genre: str
unformatted_location: str
artwork: Artwork
artwork: List[Artwork]
source_collection: SourceCollection
contact_collection: Collection[Contact]
@ -516,7 +495,7 @@ class Artist(Base):
"lyrical_themes": list,
"general_genre": lambda: "",
"artwork": Artwork,
"artwork": list,
"source_collection": SourceCollection,
"album_collection": Collection,
@ -536,7 +515,7 @@ class Artist(Base):
notes: FormattedText = None,
lyrical_themes: List[str] = None,
general_genre: str = None,
artwork: Artwork = None,
artwork: List[Artwork] = None,
unformatted_location: str = None,
source_list: List[Source] = None,
contact_list: List[Contact] = None,